jorisvandenbossche commented on code in PR #39065:
URL: https://github.com/apache/arrow/pull/39065#discussion_r1414193654


##########
cpp/src/arrow/dataset/file_parquet.cc:
##########
@@ -357,8 +357,8 @@ Result<bool> IsSupportedParquetFile(const 
ParquetFileFormat& format,
 }  // namespace
 
 std::optional<compute::Expression> 
ParquetFileFragment::EvaluateStatisticsAsExpression(
-    const Field& field, const parquet::Statistics& statistics) {
-  auto field_expr = compute::field_ref(field.name());
+    const Field& field, const FieldRef& field_ref, const parquet::Statistics& 
statistics) {
+  auto field_expr = compute::field_ref(field_ref);

Review Comment:
   I don't know if there is a better way, but the reason I am passing the 
FieldRef through the various function calls (through 
ColumnChunkStatisticsAsExpression to EvaluateStatisticsAsExpression), is that 
once we are here and we have the "schild" field, we don't know what the 
original full nested field was. 
   
   Neither the SchemaField passed to `ColumnChunkStatisticsAsExpression` nor 
the Field (`schema_field.field`) passed to `EvaluateStatisticsAsExpression` 
currently have that information AFAIK. 



##########
cpp/src/arrow/dataset/file_parquet.cc:
##########
@@ -357,8 +357,8 @@ Result<bool> IsSupportedParquetFile(const 
ParquetFileFormat& format,
 }  // namespace
 
 std::optional<compute::Expression> 
ParquetFileFragment::EvaluateStatisticsAsExpression(
-    const Field& field, const parquet::Statistics& statistics) {
-  auto field_expr = compute::field_ref(field.name());
+    const Field& field, const FieldRef& field_ref, const parquet::Statistics& 
statistics) {
+  auto field_expr = compute::field_ref(field_ref);

Review Comment:
   I don't know if there is a better way, but the reason I am passing the 
FieldRef through the various function calls (through 
ColumnChunkStatisticsAsExpression to EvaluateStatisticsAsExpression), is that 
once we are here and we have the "schild" field, we don't know what the 
original full nested field was. 
   
   Neither the SchemaField passed to `ColumnChunkStatisticsAsExpression` nor 
the Field (`schema_field.field`) passed to `EvaluateStatisticsAsExpression` 
currently have that information AFAIU. 



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