You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "etseidl (via GitHub)" <gi...@apache.org> on 2026/05/14 17:00:17 UTC

[PR] Safely ignore Parquet fields with unimplemented Thrift types [arrow-rs]

etseidl opened a new pull request, #9974:
URL: https://github.com/apache/arrow-rs/pull/9974

   # Which issue does this PR close?
   
   - Closes #9973.
   
   # Rationale for this change
   
   The thrift decoder should be able to skip fields with unimplemented thrift types `set`, `map`, and `uuid`.
   
   # What changes are included in this PR?
   
   Flesh out the thrift enums and add code to the skip function to handle the above types.
   
   # Are these changes tested?
   
   Yes, test is added
   
   # Are there any user-facing changes?
   
   No, changes are to internal APIs
   


-- 
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-unsubscribe@arrow.apache.org

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


Re: [PR] Safely ignore Parquet fields with unimplemented Thrift types [arrow-rs]

Posted by "etseidl (via GitHub)" <gi...@apache.org>.
etseidl commented on code in PR #9974:
URL: https://github.com/apache/arrow-rs/pull/9974#discussion_r3243126000


##########
parquet/src/parquet_thrift.rs:
##########
@@ -507,26 +512,38 @@ pub(crate) trait ThriftCompactInputProtocol<'a> {
             FieldType::Double => self.skip_bytes(8).map(|_| ()),
             FieldType::Binary => self.skip_binary().map(|_| ()),
             FieldType::Struct => {
-                let mut last_field_id = 0i16;

Review Comment:
   small drive-by improvement



-- 
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-unsubscribe@arrow.apache.org

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


Re: [PR] Safely ignore Parquet fields with unimplemented Thrift types [arrow-rs]

Posted by "etseidl (via GitHub)" <gi...@apache.org>.
etseidl commented on PR #9974:
URL: https://github.com/apache/arrow-rs/pull/9974#issuecomment-4452846276

   run benchmark metadata


-- 
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-unsubscribe@arrow.apache.org

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


Re: [PR] Safely ignore Parquet fields with unimplemented Thrift types [arrow-rs]

Posted by "adriangbot (via GitHub)" <gi...@apache.org>.
adriangbot commented on PR #9974:
URL: https://github.com/apache/arrow-rs/pull/9974#issuecomment-4452864316

   🤖 Arrow criterion benchmark running (GKE) | [trigger](https://github.com/apache/arrow-rs/pull/9974#issuecomment-4452846276)
   **Instance:** `c4a-highmem-16` (12 vCPU / 65 GiB) | `Linux bench-c4452846276-95-jn748 6.12.68+ #1 SMP Wed Apr  1 02:23:28 UTC 2026 aarch64 GNU/Linux`
   <details><summary>CPU Details (lscpu)</summary>
   
   ```
   Architecture:                            aarch64
   CPU op-mode(s):                          64-bit
   Byte Order:                              Little Endian
   CPU(s):                                  16
   On-line CPU(s) list:                     0-15
   Vendor ID:                               ARM
   Model name:                              Neoverse-V2
   Model:                                   1
   Thread(s) per core:                      1
   Core(s) per cluster:                     16
   Socket(s):                               -
   Cluster(s):                              1
   Stepping:                                r0p1
   BogoMIPS:                                2000.00
   Flags:                                   fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti
   L1d cache:                               1 MiB (16 instances)
   L1i cache:                               1 MiB (16 instances)
   L2 cache:                                32 MiB (16 instances)
   L3 cache:                                80 MiB (1 instance)
   NUMA node(s):                            1
   NUMA node0 CPU(s):                       0-15
   Vulnerability Gather data sampling:      Not affected
   Vulnerability Indirect target selection: Not affected
   Vulnerability Itlb multihit:             Not affected
   Vulnerability L1tf:                      Not affected
   Vulnerability Mds:                       Not affected
   Vulnerability Meltdown:                  Not affected
   Vulnerability Mmio stale data:           Not affected
   Vulnerability Reg file data sampling:    Not affected
   Vulnerability Retbleed:                  Not affected
   Vulnerability Spec rstack overflow:      Not affected
   Vulnerability Spec store bypass:         Mitigation; Speculative Store Bypass disabled via prctl
   Vulnerability Spectre v1:                Mitigation; __user pointer sanitization
   Vulnerability Spectre v2:                Mitigation; CSV2, BHB
   Vulnerability Srbds:                     Not affected
   Vulnerability Tsa:                       Not affected
   Vulnerability Tsx async abort:           Not affected
   Vulnerability Vmscape:                   Not affected
   ```
   
   </details>
   
   Comparing forward_proof_skip (63d82b763ec6ae1c562d059eb2ceb2eebe2fab8b) to 1ffd202 (merge-base) [diff](https://github.com/apache/arrow-rs/compare/1ffd202aeef1af2a3b0ab2b4ae604a9edbac6e09..63d82b763ec6ae1c562d059eb2ceb2eebe2fab8b)
   BENCH_NAME=metadata
   BENCH_COMMAND=cargo bench --features=arrow,async,test_common,experimental,object_store --bench metadata
   BENCH_FILTER=
   Results will be posted here when complete
   
   ---
   [File an issue](https://github.com/adriangb/datafusion-benchmarking/issues) against this benchmark runner


-- 
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-unsubscribe@arrow.apache.org

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


Re: [PR] Safely ignore Parquet fields with unimplemented Thrift types [arrow-rs]

Posted by "jhorstmann (via GitHub)" <gi...@apache.org>.
jhorstmann commented on code in PR #9974:
URL: https://github.com/apache/arrow-rs/pull/9974#discussion_r3247071805


##########
parquet/src/parquet_thrift.rs:
##########
@@ -507,26 +512,38 @@ pub(crate) trait ThriftCompactInputProtocol<'a> {
             FieldType::Double => self.skip_bytes(8).map(|_| ()),
             FieldType::Binary => self.skip_binary().map(|_| ()),
             FieldType::Struct => {
-                let mut last_field_id = 0i16;

Review Comment:
   I found this confusing at first, it works because skipping does not use the field id.



-- 
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-unsubscribe@arrow.apache.org

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


Re: [PR] Safely ignore Parquet fields with unimplemented Thrift types [arrow-rs]

Posted by "etseidl (via GitHub)" <gi...@apache.org>.
etseidl commented on code in PR #9974:
URL: https://github.com/apache/arrow-rs/pull/9974#discussion_r3243124101


##########
parquet/src/parquet_thrift.rs:
##########
@@ -175,25 +176,27 @@ impl TryFrom<u8> for FieldType {
             10 => Ok(Self::Set),
             11 => Ok(Self::Map),
             12 => Ok(Self::Struct),
+            13 => Ok(Self::Uuid),
             _ => Err(ThriftProtocolError::InvalidFieldType(value)),
         }
     }
 }
 
-impl TryFrom<ElementType> for FieldType {
-    type Error = ThriftProtocolError;
-    fn try_from(value: ElementType) -> std::result::Result<Self, Self::Error> {
+impl From<ElementType> for FieldType {
+    fn from(value: ElementType) -> Self {

Review Comment:
   This conversion can now be infallible



-- 
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-unsubscribe@arrow.apache.org

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


Re: [PR] Safely ignore Parquet fields with unimplemented Thrift types [arrow-rs]

Posted by "adriangbot (via GitHub)" <gi...@apache.org>.
adriangbot commented on PR #9974:
URL: https://github.com/apache/arrow-rs/pull/9974#issuecomment-4452918216

   🤖 Arrow criterion benchmark completed (GKE) | [trigger](https://github.com/apache/arrow-rs/pull/9974#issuecomment-4452846276)
   
   **Instance:** `c4a-highmem-16` (12 vCPU / 65 GiB)
   
   <details><summary>CPU Details (lscpu)</summary>
   
   ```
   Architecture:                            aarch64
   CPU op-mode(s):                          64-bit
   Byte Order:                              Little Endian
   CPU(s):                                  16
   On-line CPU(s) list:                     0-15
   Vendor ID:                               ARM
   Model name:                              Neoverse-V2
   Model:                                   1
   Thread(s) per core:                      1
   Core(s) per cluster:                     16
   Socket(s):                               -
   Cluster(s):                              1
   Stepping:                                r0p1
   BogoMIPS:                                2000.00
   Flags:                                   fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti
   L1d cache:                               1 MiB (16 instances)
   L1i cache:                               1 MiB (16 instances)
   L2 cache:                                32 MiB (16 instances)
   L3 cache:                                80 MiB (1 instance)
   NUMA node(s):                            1
   NUMA node0 CPU(s):                       0-15
   Vulnerability Gather data sampling:      Not affected
   Vulnerability Indirect target selection: Not affected
   Vulnerability Itlb multihit:             Not affected
   Vulnerability L1tf:                      Not affected
   Vulnerability Mds:                       Not affected
   Vulnerability Meltdown:                  Not affected
   Vulnerability Mmio stale data:           Not affected
   Vulnerability Reg file data sampling:    Not affected
   Vulnerability Retbleed:                  Not affected
   Vulnerability Spec rstack overflow:      Not affected
   Vulnerability Spec store bypass:         Mitigation; Speculative Store Bypass disabled via prctl
   Vulnerability Spectre v1:                Mitigation; __user pointer sanitization
   Vulnerability Spectre v2:                Mitigation; CSV2, BHB
   Vulnerability Srbds:                     Not affected
   Vulnerability Tsa:                       Not affected
   Vulnerability Tsx async abort:           Not affected
   Vulnerability Vmscape:                   Not affected
   ```
   
   </details>
   
   <details><summary>Details</summary>
   <p>
   
   ```
   group                                               forward_proof_skip                     main
   -----                                               ------------------                     ----
   decode metadata (wide) with schema                  1.00     27.6±0.41ms        ? ?/sec    1.00     27.7±0.49ms        ? ?/sec
   decode metadata (wide) with skip PES                1.00     27.0±0.33ms        ? ?/sec    1.02     27.5±0.37ms        ? ?/sec
   decode metadata (wide) with skip all stats          1.01     29.1±0.32ms        ? ?/sec    1.00     28.8±0.39ms        ? ?/sec
   decode metadata (wide) with skip column stats       1.01     28.5±0.39ms        ? ?/sec    1.00     28.3±0.42ms        ? ?/sec
   decode metadata (wide) with skip size stats         1.00     30.9±0.42ms        ? ?/sec    1.01     31.2±0.43ms        ? ?/sec
   decode metadata (wide) with stats mask              1.00     27.0±0.36ms        ? ?/sec    1.01     27.3±0.44ms        ? ?/sec
   decode metadata with schema                         1.00      4.0±0.02µs        ? ?/sec    1.02      4.0±0.02µs        ? ?/sec
   decode metadata with skip PES                       1.00      6.9±0.03µs        ? ?/sec    1.00      6.9±0.02µs        ? ?/sec
   decode metadata with skip column stats              1.00      6.7±0.11µs        ? ?/sec    1.00      6.8±0.03µs        ? ?/sec
   decode metadata with stats mask                     1.01      6.9±0.07µs        ? ?/sec    1.00      6.8±0.04µs        ? ?/sec
   decode parquet metadata                             1.00      7.1±0.04µs        ? ?/sec    1.00      7.1±0.02µs        ? ?/sec
   decode parquet metadata (wide)                      1.00     29.6±0.41ms        ? ?/sec    1.01     29.8±0.47ms        ? ?/sec
   decode parquet metadata no path_in_schema (wide)    1.00     28.9±0.41ms        ? ?/sec    1.01     29.1±0.47ms        ? ?/sec
   decode parquet metadata w/ size stats (wide)        1.00     36.1±0.38ms        ? ?/sec    1.02     36.6±0.39ms        ? ?/sec
   open(default)                                       1.00      7.7±0.02µs        ? ?/sec    1.00      7.7±0.01µs        ? ?/sec
   open(page index)                                    1.00    132.2±0.10µs        ? ?/sec    1.00    132.4±0.14µs        ? ?/sec
   ```
   
   </p>
   </details>
   
   <details><summary>Resource Usage</summary>
   
   **base (merge-base)**
   | Metric | Value |
   |--------|-------|
   | Wall time | 160.0s |
   | Peak memory | 4.3 GiB |
   | Avg memory | 4.2 GiB |
   | CPU user | 154.3s |
   | CPU sys | 0.8s |
   | Peak spill | 0 B |
   
   **branch**
   | Metric | Value |
   |--------|-------|
   | Wall time | 155.0s |
   | Peak memory | 4.2 GiB |
   | Avg memory | 4.2 GiB |
   | CPU user | 153.2s |
   | CPU sys | 0.2s |
   | Peak spill | 0 B |
   </details>
   
   
   ---
   [File an issue](https://github.com/adriangb/datafusion-benchmarking/issues) against this benchmark runner


-- 
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-unsubscribe@arrow.apache.org

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


Re: [PR] Safely ignore Parquet fields with unimplemented Thrift types [arrow-rs]

Posted by "etseidl (via GitHub)" <gi...@apache.org>.
etseidl commented on PR #9974:
URL: https://github.com/apache/arrow-rs/pull/9974#issuecomment-4461026930

   Thanks @alamb and @jhorstmann for the reviews ❤️ 


-- 
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-unsubscribe@arrow.apache.org

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


Re: [PR] Safely ignore Parquet fields with unimplemented Thrift types [arrow-rs]

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on code in PR #9974:
URL: https://github.com/apache/arrow-rs/pull/9974#discussion_r3243998509


##########
parquet/src/parquet_thrift.rs:
##########
@@ -507,26 +512,38 @@ pub(crate) trait ThriftCompactInputProtocol<'a> {
             FieldType::Double => self.skip_bytes(8).map(|_| ()),
             FieldType::Binary => self.skip_binary().map(|_| ()),
             FieldType::Struct => {
-                let mut last_field_id = 0i16;
                 loop {
-                    let field_ident = self.read_field_begin(last_field_id)?;
+                    let field_ident = self.read_field_begin(0)?;
                     if field_ident.field_type == FieldType::Stop {
                         break;
                     }
                     self.skip_till_depth(field_ident.field_type, depth - 1)?;
-                    last_field_id = field_ident.id;
                 }
                 Ok(())
             }
-            FieldType::List => {
+            // lists and sets are encoded the same

Review Comment:
   A link to the spec might help: https://github.com/apache/thrift/blob/master/doc/specs/thrift-compact-protocol.md#list-and-set



##########
parquet/src/parquet_thrift.rs:
##########
@@ -507,26 +512,38 @@ pub(crate) trait ThriftCompactInputProtocol<'a> {
             FieldType::Double => self.skip_bytes(8).map(|_| ()),
             FieldType::Binary => self.skip_binary().map(|_| ()),
             FieldType::Struct => {
-                let mut last_field_id = 0i16;
                 loop {
-                    let field_ident = self.read_field_begin(last_field_id)?;
+                    let field_ident = self.read_field_begin(0)?;
                     if field_ident.field_type == FieldType::Stop {
                         break;
                     }
                     self.skip_till_depth(field_ident.field_type, depth - 1)?;
-                    last_field_id = field_ident.id;
                 }
                 Ok(())
             }
-            FieldType::List => {
+            // lists and sets are encoded the same
+            FieldType::List | FieldType::Set => {
                 let list_ident = self.read_list_begin()?;
+                let element_type = FieldType::from(list_ident.element_type);
                 for _ in 0..list_ident.size {
-                    let element_type = FieldType::try_from(list_ident.element_type)?;
                     self.skip_till_depth(element_type, depth - 1)?;
                 }
                 Ok(())
             }
-            // no list or map types in parquet format
+            FieldType::Map => {

Review Comment:
   maybe it would help to add a link to the relevant part of the thrift encoding spec:  https://github.com/apache/thrift/blob/master/doc/specs/thrift-compact-protocol.md#map



-- 
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-unsubscribe@arrow.apache.org

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


Re: [PR] Safely ignore Parquet fields with unimplemented Thrift types [arrow-rs]

Posted by "etseidl (via GitHub)" <gi...@apache.org>.
etseidl merged PR #9974:
URL: https://github.com/apache/arrow-rs/pull/9974


-- 
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-unsubscribe@arrow.apache.org

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


Re: [PR] Safely ignore Parquet fields with unimplemented Thrift types [arrow-rs]

Posted by "etseidl (via GitHub)" <gi...@apache.org>.
etseidl commented on code in PR #9974:
URL: https://github.com/apache/arrow-rs/pull/9974#discussion_r3243139912


##########
parquet/src/parquet_thrift.rs:
##########
@@ -507,26 +512,38 @@ pub(crate) trait ThriftCompactInputProtocol<'a> {
             FieldType::Double => self.skip_bytes(8).map(|_| ()),
             FieldType::Binary => self.skip_binary().map(|_| ()),
             FieldType::Struct => {
-                let mut last_field_id = 0i16;
                 loop {
-                    let field_ident = self.read_field_begin(last_field_id)?;
+                    let field_ident = self.read_field_begin(0)?;
                     if field_ident.field_type == FieldType::Stop {
                         break;
                     }
                     self.skip_till_depth(field_ident.field_type, depth - 1)?;
-                    last_field_id = field_ident.id;
                 }
                 Ok(())
             }
-            FieldType::List => {
+            // lists and sets are encoded the same
+            FieldType::List | FieldType::Set => {
                 let list_ident = self.read_list_begin()?;
+                let element_type = FieldType::from(list_ident.element_type);
                 for _ in 0..list_ident.size {
-                    let element_type = FieldType::try_from(list_ident.element_type)?;
                     self.skip_till_depth(element_type, depth - 1)?;
                 }
                 Ok(())
             }
-            // no list or map types in parquet format
+            FieldType::Map => {

Review Comment:
   A map begins with a varint `size`. If `size` is `0` it's empty. Otherwise, the next byte encodes the key and value types with 4 bits each, and then encodes `size` key/value pairs.



-- 
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-unsubscribe@arrow.apache.org

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


Re: [PR] Safely ignore Parquet fields with unimplemented Thrift types [arrow-rs]

Posted by "jhorstmann (via GitHub)" <gi...@apache.org>.
jhorstmann commented on PR #9974:
URL: https://github.com/apache/arrow-rs/pull/9974#issuecomment-4458461965

   Looks good to me!


-- 
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-unsubscribe@arrow.apache.org

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