Conversation
…ript TRANSFORM output Support CHAR/VARCHAR output from script TRANSFORM with and without Hive SerDe when first-class semantics are enabled. Separated from SPARK-59277 (Hive inspector conversion and UDF/UDAF/UDTF support) per review feedback. JIRA: https://issues.apache.org/jira/browse/SPARK-59683 - No-SerDe: CHAR/VARCHAR scalar, nested, and complex output with padding, overflow, null-token, and malformed-field handling. - No-SerDe nested maps: restore JSON string keys to the declared physical key type through a per-row ArrayBasedMapBuilder that validates null and duplicate converted keys. - SerDe: rewrite LazySimpleSerDe CHAR/VARCHAR output types to STRING so Spark applies first-class length checks; non-LazySimpleSerDe SerDes keep the declared schema.
srielau
force-pushed
the
serge-rielau_data/SPARK-59277-transform
branch
from
September 21, 2026 05:20
3c1b9b3 to
c37e319
Compare
srielau
marked this pull request as ready for review
September 21, 2026 05:21
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.
What changes were proposed in this pull request?
Support first-class CHAR/VARCHAR output from script TRANSFORM when first-class semantics are enabled. Split out from #58584 (Hive inspector conversion + UDF/UDAF/UDTF) per review feedback.
EXCEED_LIMIT_LENGTH), null-token, and malformed-field handling.ArrayBasedMapBuilderthat validates null and duplicate converted keys.LazySimpleSerDeCHAR/VARCHAR output types to STRING so Spark applies first-class length checks. Non-LazySimpleSerDeSerDes keep the declared CHAR/VARCHAR schema.This PR depends on #58584 for Hive inspector CHAR/VARCHAR conversion. JIRA: https://issues.apache.org/jira/browse/SPARK-59683
Why are the changes needed?
With
spark.sql.charVarchar.standardSemantics.enabled=true, script TRANSFORM output was not aware of CHAR/VARCHAR types. Bounded-string values passed through without padding or length enforcement, and nested output containing non-string map keys was not restored from the JSON string representation.Does this PR introduce any user-facing change?
Yes. When first-class CHAR/VARCHAR semantics are enabled, script TRANSFORM now pads CHAR output, enforces length limits on both CHAR and VARCHAR, and correctly handles nested CHAR/VARCHAR in arrays, maps, and structs. Legacy flag-off behavior remains unchanged.
How was this patch tested?
Added focused coverage for:
LazySimpleSerDe-only CHAR/VARCHAR type rewrite verification.Ran:
Was this patch authored or co-authored using generative AI tooling?
Generated-by: Cursor Auto