Skip to content

Commit cf8582b

Browse files
XiangpengHaoalamb
andauthored
Add builder to help create Schemas for shredding (ShreddedSchemaBuilder) (#8940)
- Closes #8922 # Rationale for this change Basically a helper to simplify this: ```rust let shredding_type = ShredTypeBuilder::default() .with_path("a", &DataType::Int64) .with_path("b.c", &DataType::Utf8) .with_path("b.d", &DataType::Float64) .build(); assert_eq!( shredding_type, DataType::Struct(Fields::from(vec![ Field::new("a", DataType::Int64, true), Field::new( "b", DataType::Struct(Fields::from(vec![ Field::new("c", DataType::Utf8, true), Field::new("d", DataType::Float64, true), ])), true ), ])) ); ``` # What changes are included in this PR? 1. Added `ShredTypeBuilder` 2. Updated existing tests cases to use this new primitive # Are these changes tested? Yes # Are there any user-facing changes? Add a new public interface --------- Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
1 parent 4601838 commit cf8582b

File tree

3 files changed

+483
-25
lines changed

3 files changed

+483
-25
lines changed

parquet-variant-compute/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ pub use variant_array_builder::{VariantArrayBuilder, VariantValueArrayBuilder};
5656

5757
pub use cast_to_variant::{cast_to_variant, cast_to_variant_with_options};
5858
pub use from_json::json_to_variant;
59-
pub use shred_variant::shred_variant;
59+
pub use shred_variant::{IntoShreddingField, ShreddedSchemaBuilder, shred_variant};
6060
pub use to_json::variant_to_json;
6161
pub use type_conversion::CastOptions;
6262
pub use unshred_variant::unshred_variant;

0 commit comments

Comments
 (0)