adriangb commented on code in PR #20698:
URL: https://github.com/apache/datafusion/pull/20698#discussion_r2885103568


##########
datafusion/datasource-parquet/src/row_filter.rs:
##########
@@ -437,15 +412,12 @@ fn pushdown_columns(
 fn leaf_indices_for_roots(
     root_indices: &[usize],
     schema_descr: &SchemaDescriptor,
-    nested: NestedColumnSupport,
 ) -> Vec<usize> {
-    // For primitive-only columns, root indices ARE the leaf indices
-    if nested == NestedColumnSupport::PrimitiveOnly {
-        return root_indices.to_vec();
-    }
-
-    // For List columns, expand to the single leaf column (item field)
-    // For Struct columns (unsupported), this would expand to multiple leaves
+    // Always map root (Arrow) indices to Parquet leaf indices via the schema
+    // descriptor. Arrow root indices only equal Parquet leaf indices when the
+    // schema has no group columns (Struct, Map, etc.); when group columns
+    // exist, their children become separate leaves and shift all subsequent
+    // leaf indices.

Review Comment:
   ```suggestion
       // Always map root (Arrow) indices to Parquet leaf indices via the schema
       // descriptor. Arrow root indices only equal Parquet leaf indices when 
the
       // schema has no group columns (Struct, Map, etc.); when group columns
       // exist, their children become separate leaves and shift all subsequent
       // leaf indices.
       // Struct columns are unsupported.
   ```



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to