comphead commented on code in PR #6246:
URL: https://github.com/apache/datafusion-comet/pull/6246#discussion_r4645583873


##########
native/core/src/parquet/schema_adapter.rs:
##########
@@ -1409,6 +1447,100 @@ impl SparkPhysicalExprAdapter {
         .data()
     }
 
+    /// A `binaryAsString` scan reads string columns as Binary and decodes 
them to strings with a
+    /// Spark cast, in its output projection and in the filters it pushes. 
Where arrow-rs reads
+    /// the column as Utf8, the default adapter makes that `CAST(CAST(s AS 
BINARY) AS STRING)`.
+    /// Use the column itself to skip both casts and let filters prune. This 
preserves the
+    /// setting-off behavior: arrow-rs validates UTF8-annotated columns, but 
JSON annotations and
+    /// Utf8 `ARROW:schema` hints can still yield unchecked string arrays.

Review Comment:
   The comment now says JSON annotations and `Utf8` `ARROW:schema` hints reach 
the output unchecked, and the contributor and user docs repeat it. 
`binary_as_string_reads_annotated_strings_without_casts` only builds a plain 
`Utf8` physical schema, so nothing pins that shape. If arrow-rs or the collapse 
rule changes, the docs would drift without a failing test. A case that writes 
an unannotated `BINARY` column with a `Utf8` `ARROW:schema` hint and asserts 
the scan output has no `Cast` would cover the second case. I have not tried 
writing it, and a JSON-annotated column may need the low-level writer.



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