alamb commented on code in PR #7535:
URL: https://github.com/apache/arrow-rs/pull/7535#discussion_r2103238782


##########
parquet-variant/src/decoder.rs:
##########
@@ -0,0 +1,199 @@
+// NOTE: Largely based on the implementation of @PinkCrow007 in 
https://github.com/apache/arrow-rs/pull/7452
+// And the feedback there.
+use crate::variant::VariantType;
+use arrow_schema::ArrowError;
+use std::{array::TryFromSliceError, str};
+
+#[derive(Debug, Clone, Copy)]
+pub enum VariantBasicType {
+    Primitive = 0,
+    ShortString = 1,
+    Object = 2,
+    Array = 3,
+}
+
+#[derive(Debug, Clone, Copy)]
+pub enum VariantPrimitiveType {
+    Null = 0,
+    BooleanTrue = 1,
+    BooleanFalse = 2,

Review Comment:
   I agree encoding boolean like this is somewhat strange, but I do think it 
makes sense to follow the spec closely here as this PR does
   
   For reference: 
https://github.com/apache/parquet-format/blob/master/VariantEncoding.md#encoding-types
   
   
   Equivalence Class | Variant Physical Type | Type ID | Equivalent Parquet 
Type | Binary format
   -- | -- | -- | -- | --
   NullType | null | 0 | UNKNOWN | none
   Boolean | boolean (True) | 1 | BOOLEAN | none
   Boolean | boolean (False) | 2 | BOOLEAN | none
   
   



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to