chore(audit): audit map expressions across Spark 3.4.3, 3.5.8, 4.0.1, 4.1.1#4478
Open
andygrove wants to merge 1 commit into
Open
chore(audit): audit map expressions across Spark 3.4.3, 3.5.8, 4.0.1, 4.1.1#4478andygrove wants to merge 1 commit into
andygrove wants to merge 1 commit into
Conversation
… 4.1.1 Add per-version audit sub-bullets to `element_at`, `map_contains_key`, `map_entries`, `map_from_arrays`, `map_from_entries`, `map_keys`, `map_values`, and `str_to_map` in `docs/source/contributor-guide/spark_expressions_support.md`. Most of the category is byte-for-byte identical across the four versions. Spark 4.0 adds the usual collation widening (`StringTypeNonCSAICollation` on `StringToMap`) and the `nullIntolerant` field refactor. Spark 4.1 adds a `legacySplitTruncate` flag to `StringToMap` driven by `spark.sql.legacy.truncateForEmptyRegexSplit` that the Comet native impl does not honour. Apply support-level consistency fixes surfaced by the audit: - `CometMapFromEntries`: rephrase the BinaryType reasons to read consistently (`BinaryType` is not supported as a map key/value in `map_from_entries`) and backtick the type name and function name. - `CometStrToMap`: drop the no-op `getSupportLevel` override (it returned `Compatible(None)`, which is also the default). Update the affected test references in `CometMapExpressionSuite` (via the shared constants) and the `expressions/map/map_from_entries.sql` fallback substring matchers. Tracking issue filed for the gap found: - apache#4477 `str_to_map` does not honour Spark 4.1.1 `legacy.truncateForEmptyRegexSplit` flag (referenced from the `str_to_map` sub-bullet).
This was referenced May 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Closes #.
Rationale for this change
Continuation of the per-category expression audit. Same pattern as #4476 (hash), #4475 (conditional), #4474 (misc), #4473 (collection), #4470 (json), #4469 (struct), using the updated
audit-comet-expressionskill in #4468.What changes are included in this PR?
Support-doc audit notes
Add per-version audit sub-bullets to
element_at,map_contains_key,map_entries,map_from_arrays,map_from_entries,map_keys,map_values, andstr_to_map. Most of the category is byte-for-byte identical across the four versions. Spark 4.0 adds the usual collation widening (StringTypeNonCSAICollationonStringToMap) and thenullIntolerant: Booleanfield refactor. Spark 4.1 adds alegacySplitTruncateflag toStringToMap.Support-level consistency fixes (in
maps.scala)CometMapFromEntries: rephrase the BinaryType reasons to read consistently (`BinaryType` is not supported as a map key/value in `map_from_entries`) and backtick the type name and function name.CometStrToMap: drop the no-opgetSupportLeveloverride (it returnedCompatible(None), which is also the default).Update the affected test references in
CometMapExpressionSuite(via the shared constants) and theexpressions/map/map_from_entries.sqlfallback substring matchers.Tracking issues filed for follow-up
str_to_mapdoes not honour Spark 4.1.1legacy.truncateForEmptyRegexSplitflag.The previously closed #3327 (
map_from_arraysnull-input crash) is referenced from themap_from_arrayssub-bullet.Audit process
Audited directly using the
audit-comet-expressionskill (4 Spark versions per #4468). Eight serdes plus existing test coverage.How are these changes tested?
./mvnw test -Dsuites="org.apache.comet.CometSqlFileTestSuite expressions/map/" -Dtest=none(9 tests pass after updating the substring matchers)./mvnw test -Dsuites="org.apache.comet.CometMapExpressionSuite" -Dtest=none(8 succeeded, 1 already-ignored)make coresucceeds.