ByteBaker commented on code in PR #10327:
URL: https://github.com/apache/arrow-rs/pull/10327#discussion_r3585339650


##########
parquet_derive/src/parquet_field.rs:
##########
@@ -299,28 +312,25 @@ impl Field {
         // becomes a column named `type` in the parquet schema
         let field_name = self.ident.unraw().to_string();
         let physical_type = match self.ty.physical_type() {
-            parquet::basic::Type::BOOLEAN => quote! {
+            PhysicalType::Boolean => quote! {
                 ::parquet::basic::Type::BOOLEAN
             },
-            parquet::basic::Type::INT32 => quote! {
+            PhysicalType::Int32 => quote! {
                 ::parquet::basic::Type::INT32
             },
-            parquet::basic::Type::INT64 => quote! {
+            PhysicalType::Int64 => quote! {
                 ::parquet::basic::Type::INT64
             },
-            parquet::basic::Type::INT96 => quote! {
-                ::parquet::basic::Type::INT96

Review Comment:
   Sorry for not explaining this.
   
   The match arms come from `self.ty.physical_type()`, but the said method 
never really returned `INT96` or constructed it inside the implementation.
   
   Which is why I did not add a `Int96` variant in the new (private to 
`parquet_derive`) `PhysicalType`.
   
   ```rust
   enum PhysicalType {
       Boolean,
       Int32,
       Int64,
       Float,
       Double,
       ByteArray,
       FixedLenByteArray,
   }
   ```
   
   At the same time, I also noticed that INT96 has been marked deprecated 
inside `parquet/src/basic.rs`, making it unlikely that anyone in the future 
would construct this type.
   
   ```rust
   enum Type {
     INT96 = 3;  // deprecated, only used by legacy implementations.
   }
   ```
   
   Which convinced me that this can be safely removed. All it does is remove an 
unreachable branch.
   
   What do you think?



-- 
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