Skip to content

[SPARK-57223][SQL]Wrong display of column or struct field containing a dot or space in error messages#56294

Draft
jiwen624 wants to merge 2 commits into
apache:masterfrom
jiwen624:spark-57223-toSQLId-special-char-error-msg
Draft

[SPARK-57223][SQL]Wrong display of column or struct field containing a dot or space in error messages#56294
jiwen624 wants to merge 2 commits into
apache:masterfrom
jiwen624:spark-57223-toSQLId-special-char-error-msg

Conversation

@jiwen624
Copy link
Copy Markdown
Contributor

@jiwen624 jiwen624 commented Jun 3, 2026

What changes were proposed in this pull request?

Why are the changes needed?

Does this PR introduce any user-facing change?

How was this patch tested?

Was this patch authored or co-authored using generative AI tooling?

jiwen624 and others added 2 commits June 2, 2026 14:38
…special-char column names

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ld names containing dots or spaces

`DataTypeErrorsBase.toSQLId(String)` was calling `AttributeNameParser.parseAttributeName`
which treats the input as SQL text and splits on dots, so a stored column name like
`job.title` was rendered as `\`job\`.\`title\`` instead of `\`job.title\`` in error messages.

Fix the String overload to delegate to `toSQLId(Seq(parts))`, treating the input as a
single verbatim identifier. Pre-formatted callers (E1-E6) that relied on the old
re-parsing behaviour are corrected: `ResolvedTable.name` used directly, `column.quoted`
replaced with `column.toImmutableArraySeq`, `col.name.quoted` replaced with `col.name`,
`FunctionIdentifier`/`TableIdentifier` use `nameParts`, and the JDBC table identifier
uses `ident.namespace().toSeq :+ ident.name()`. Table display names in
`TableOutputResolver` error functions are pre-formatted by callers and passed through
as-is.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@jiwen624 jiwen624 changed the title Spark 57223 to sql id special char error msg [SPARK-57223][SQL]Wrong display of column or struct field containing a dot or space in error messages Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant