-
Notifications
You must be signed in to change notification settings - Fork 990
Add variant_experimental
feature to parquet
crate
#8133
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
base: main
Are you sure you want to change the base?
Conversation
variant
feature to parquet
cratevariant
feature to parquet
crate
ed04fb5
to
7ab46a1
Compare
variant
feature to parquet
cratevariant_experimental
feature to parquet
crate
variant_experimental
feature to parquet
cratevariant_experimental
feature to parquet
crate
7ab46a1
to
0ec7656
Compare
0ec7656
to
be5cf31
Compare
//! [`VariantArray`]: compute::VariantArray | ||
//! [`variant_get`]: compute::variant_get | ||
//! | ||
//! # Example: Writing a Parquet file with Variant column |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Being able to write this example is the largest rationale in my mind for the feature flag in the parquet crate
//! variant_builder.finish(); | ||
//! let array = builder.build(); | ||
//! | ||
//! // TODO support writing VariantArray directly |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will file a follow on ticket for this problem
//! let batch = RecordBatch::try_from_iter(vec![("data", array)])?; | ||
//! | ||
//! // write the RecordBatch to a Parquet file | ||
//! let file = std::fs::File::create("variant-json.parquet")?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is kind of neat to see the data written. I looked at the resulting file using datafusion-cli
and it looks like like this (note it does not have the parquet logical annotation on it)
> select * from 'parquet/variant-json.parquet';
+-----------------------------------------------------------------------------------------------------------------------------------+
| data |
+-----------------------------------------------------------------------------------------------------------------------------------+
| {metadata: 11020003076167656e616d65, value: 020200010002080c1e15416c696365} |
| {metadata: 010400040b0e1263697479616464726573736167656e616d65, value: 0203010203000e10140201000009214e657720596f726b0c190d426f62} |
| {metadata: 010000, value: 020000} |
| {metadata: 010000, value: 020000} |
+-----------------------------------------------------------------------------------------------------------------------------------+
4 row(s) fetched.
Elapsed 0.003 seconds.
I would like to know if there are any objections to this approach from other maintainers such as @Dandandan @etseidl @waynexia @tustvold and @mbrobbel Also, other Variant contributors like @carpecodeum @scovich @mprammer @klion26 @friendlymatthew please provide any feedback if you have it |
No objections from me. |
Very exciting. Thank you! |
Thank you for pushing this forward! |
Which issue does this PR close?
variant
feature toparquet
crate #8132Rationale for this change
TLDR is we need a way to test and work out how Variant integration with the actual parquet reader/writer will look, so let's do it in the parquet crate.
Please see the essay on #8132 for background
Follow on tasks (I will file tickets for these items if we agree on this as an integration mechanism):
panic
when writing VariantArray with the ArrowWriterVariantArray
variant_experimental
flag tovariant
and remove warnings about being experimentalFollow up tasks that came out of this PR but do not depend on it
StringView
andLargeString
in ´batch_json_string_to_variant` #8145batch_json_string_to_variant
andbatch_variant_to_json_string
json_to_variant #8144What changes are included in this PR?
variant_experimental
feature to theparquet
crateAre these changes tested?
Yes by new CI
Are there any user-facing changes?
This adds a new feature flag, and new