Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coerce selected Arrow types in vgplot. #184

Merged
merged 1 commit into from
Sep 21, 2023
Merged

Coerce selected Arrow types in vgplot. #184

merged 1 commit into from
Sep 21, 2023

Conversation

jheer
Copy link
Member

@jheer jheer commented Sep 21, 2023

  • Map Arrow Timestamp types to JS Date objects, rather than numbers.
  • Map Arrow Int64 types to JS Number instances, rather than BigInt. (FWIW, Plot already does this internally.)

These changes apply to unpacking of Arrow tables within vgplot only. We unpack an Arrow table into an array-of-objects format. This was already happening implicitly (using possibly slower Proxy objects); we now do it explicitly with control over type conversions. In the future, if Plot adds support for columnar data we could modify our approach to take advantage of that and reduce data copy costs.

Mosaic client implementations still receive a standard, unaltered Arrow table. This PR targets vgplot mark internals.

Possible future work:

  • coerce other types, such as Time values?
  • refactor coercion support to a utility library for other client implementations to use if desired.

Close #155.
Close #176.

@jheer jheer merged commit bba97f6 into main Sep 21, 2023
2 checks passed
@jheer jheer deleted the jh/arrow-convert branch September 21, 2023 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enable the castTimestampToDate option for duckdb-wasm?
1 participant