Repository navigation
fix: support binaryAsString in the native Parquet scan #6246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
b0757c3
c6a2b33
b1ea849
f5408c3
293210a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -182,6 +182,12 @@ page-index, and bloom-filter pruning happen regardless of this flag whenever Spa | |
| `spark.sql.parquet.filterPushdown` is on, except for filters that compare `FLOAT` or `DOUBLE` values, | ||
| which do not prune while this flag is on (see [Floating-point Number Comparison](compatibility/floating-point.md)). | ||
|
|
||
| With `spark.sql.parquet.binaryAsString=true`, the native scan reads every top-level string column | ||
| as binary and decodes it after reading. Filters on those columns prune only for `=`, `IN` and | ||
| `IS [NOT] NULL` against a literal without `U+FFFD`, which the scan compares as raw bytes. Other | ||
| filters on them, such as ranges and `LIKE`, don't prune while the setting is on, even for columns | ||
| the file annotates as strings. | ||
|
|
||
| ### Row Group Assignment to Splits | ||
|
|
||
| Spark and DataFusion's native Parquet scans use different rules to decide which row groups belong to a | ||
|
|
@@ -264,11 +270,14 @@ for production, so do not turn it off to avoid an entry on this page. | |
| and 4.0, and to Spark 4.1 and later with | ||
| `spark.sql.legacy.parquet.returnNullStructIfAllFieldsMissing=true` | ||
| ([#7030](https://github.com/apache/datafusion-comet/issues/7030)). | ||
| - **Nested BINARY values that are not valid UTF-8, read as STRING.** This applies to a BINARY | ||
| column without the UTF8 annotation that is read as `string`, through the read schema or | ||
| - **BINARY values that are not valid UTF-8, read as STRING.** This applies to a BINARY column | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This bullet and #7106 rewrite the same lines, and |
||
| without the UTF8 annotation that is read as `string`, through the read schema or | ||
| `spark.sql.parquet.binaryAsString=true`. Spark returns the bytes. Comet returns NULL for each | ||
| such nested value. Top-level values match Spark in a release build, because the invalid bytes | ||
| reach an Arrow string array unchecked. A debug build panics on them | ||
| such nested value. At the top level, `spark.sql.parquet.binaryAsString=true` replaces each | ||
| ill-formed sequence with `U+FFFD`, as described in | ||
| [Strings with non-UTF-8 bytes](compatibility/index.md#strings-with-non-utf-8-bytes). Through a | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The linked section still says non-UTF-8 strings don't occur in text read from Parquet. Could it mention this |
||
| read schema, top-level values reach an Arrow string array unchecked: they match Spark in a | ||
| release build, and a debug build panics on them | ||
| ([#7032](https://github.com/apache/datafusion-comet/issues/7032), part of | ||
| [#4764](https://github.com/apache/datafusion-comet/issues/4764)). | ||
| - **Field-id reads where one file column matches a field by id and a sibling by name.** With | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1543,6 +1543,7 @@ mod tests { | |
| false, | ||
| false, | ||
| false, | ||
| false, | ||
| &session, | ||
| false, | ||
| false, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -82,6 +82,7 @@ fn scan( | |
| false, | ||
| allow_type_promotion, | ||
| false, | ||
| false, | ||
| session, | ||
| false, | ||
| false, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -67,6 +67,7 @@ fn partitioned_scan( | |
| false, | ||
| false, | ||
| false, | ||
| false, | ||
| session, | ||
| false, | ||
| false, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -192,6 +192,7 @@ fn parquet_scan( | |
| false, | ||
| allow_type_promotion, | ||
| false, | ||
| false, | ||
| session, | ||
| false, | ||
| false, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -91,6 +91,7 @@ fn timestamp_input( | |
| false, | ||
| false, | ||
| false, | ||
| false, | ||
| session, | ||
| false, | ||
| false, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The other two audited entries in this file record a
Spark versions checkedline. Could this one list the versions whose schema converter andParquetFilterswere compared, so the audit entries stay uniform?