taiyang-li commented on code in PR #11899:
URL: https://github.com/apache/gluten/pull/11899#discussion_r3542590125


##########
gluten-substrait/src/main/scala/org/apache/gluten/execution/BasicScanExecTransformer.scala:
##########
@@ -112,14 +112,26 @@ trait BasicScanExecTransformer extends 
LeafTransformSupport with BaseDataSource
       case _ => Seq(partition)
     }
 
+    val metadataFromSpark = getMetadataColumns().map(_.name)
+
+    val inputFileRelatedMetadataKeys = Seq(
+      InputFileName().prettyName,
+      InputFileBlockStart().prettyName,
+      InputFileBlockLength().prettyName)
+
+    val neededInputFileRelatedMetadataKeys =
+      inputFileRelatedMetadataKeys.filter(k => output.exists(_.name == k))

Review Comment:
   @rui-mo I found gluten main doesn't support metadata columns like 
`input_file_name()` only in filter condition, e.g. `select id from table where 
input_file_name like '%parquet%'`. It will produce wrong result.  I fixed it in 
current pr. 
   
   After that, medata columns would be pushed down to scan. The case you 
described before won't happen. Besides, I added ut to make sure it it ok. 



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