LuciferYang opened a new issue, #13713: URL: https://github.com/apache/gluten/issues/13713
`PushDownInputFileExpression` moves `input_file_name()` and the block start/length functions into the native scan. Three plan shapes get it wrong. 1. A column a lower projection named `input_file_name` is treated like a call to the function. The rule wraps an empty projection over the scan, the projections are later merged, and `input_file_name()` is evaluated above the native scan, where it returns an empty string. With default settings, `SELECT concat(input_file_name, '#') FROM (SELECT input_file_name() AS input_file_name, name FROM t)` returns `#` instead of `<path>#`, and adding `WHERE input_file_name LIKE '%.parquet'` returns no rows. 2. When the projection stays on Spark (it calls a Scala UDF, or `spark.gluten.sql.columnar.project=false`) and computes other columns, the rule still replaces it with the scan, which can't produce those columns. With project offload off, `SELECT concat(input_file_name(), name) FROM t` returns null. A Scala UDF in the same projection, as in `SELECT input_file_name(), my_udf(name) FROM t`, gets a null input. 3. For a DSv2 scan, the rule drops a projection under another projection even when it renames the column. With `spark.sql.sources.useV1SourceList=""` and project offload off, `SELECT concat(f, name) FROM (SELECT input_file_name() AS f, name FROM t)` returns null. All three reproduce on v1.8.0-rc1. This issue was written with the assistance of AI (Claude Opus). -- 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]
