alamb commented on PR #7921:
URL: https://github.com/apache/arrow-rs/pull/7921#issuecomment-3115137192

   👋  I am just checking in to see how this PR is going
   
   I am not sure if it is correct, but I am thinking this PR is the first part 
of the "writing shredded variants" story
   
   In order to drive it forward, I wonder if it might be a good idea to try and 
pick some simple test cases -- for example, try to write a test that produces 
the output VarantArray that is manually constructed in:
   
   - https://github.com/apache/arrow-rs/pull/7965
   
   So perhaps that would mean a test like
   ```rust
   // create a shredded schema that specifies shredding as Int32
   let schema = ...; // Not sure??
   
   // make an array builder with that schema
   let mut builder = VariantArrayBuilder::new()
     .with_schema(shredded_schema);
   
   // first row is value 34
   let row0 = builder.variant_builder()
   row0.append_variant(Variant::Int32(34));
   row0.finish()
   // second row is null
   builder.append_null();
   //third row is "n/a" (a string)
   let row2 = builder.variant_builder()
   row2.append_variant(Variant::from("n/a"));
   row2.finish()
   // fourth row is value 100
   let row3 = builder.variant_builder()
   row3.append_variant(Variant::Int32(100));
   row3.finish()
   
   // complete the array
   let array = builder.finish();
   
   // verify that the resulting array is a StructArray with the 
   // structure specified in https://github.com/apache/arrow-rs/pull/7965
   
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to