Skip to content

Spark: Backport Z-order null boolean and case-insensitive column fixes to 3.5, 4.0 and 4.2 - #18077

Merged
huaxingao merged 1 commit into
apache:mainfrom
GGraziadei:backport-zorder-null-and-case-handling
Sep 12, 2026
Merged

huaxingao merged 1 commit into
apache:mainfrom
GGraziadei:backport-zorder-null-and-case-handling

Conversation

@GGraziadei

Copy link
Copy Markdown
Member

Backport of #17669 to Spark 3.5, 4.0 and 4.2, as noted in that PR.

The main-source changes are identical to the 4.1 version:

  • SparkZOrderUDF.booleanToOrderedBytesUDF() returns PRIMITIVE_EMPTY for a null Boolean instead of throwing an NPE, matching the null-sorts-lowest convention already used by the other converters.
  • SparkZOrderFileRewriteRunner.validZOrderColNames stores the resolved field name rather than the caller's spelling, so a case-insensitive match no longer fails later in zValue.

The three regression tests from #17669 (zOrderUDFEncodesNullValuesAsZeroBytes, zOrderSortWithNullBooleanValues, zOrderSortWithMismatchedColumnCase) are added to TestRewriteDataFilesAction for each version.

@github-actions github-actions Bot added the spark label Sep 12, 2026
@GGraziadei

Copy link
Copy Markdown
Member Author

Hi @huaxingao, @nssalian happy to receive your review. This a simple backport of #17669

@huaxingao
huaxingao merged commit 4987c84 into apache:main Sep 12, 2026
36 checks passed
@huaxingao

Copy link
Copy Markdown
Contributor

Thanks @GGraziadei for the PR!

@nssalian

Copy link
Copy Markdown
Collaborator

Thanks for the backport. Glad to see this complete

@GGraziadei
GGraziadei deleted the backport-zorder-null-and-case-handling branch September 12, 2026 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants