Skip to content

fix: Panic in Spark's format_string for illegal characters#22077

Open
neilconway wants to merge 1 commit intoapache:mainfrom
neilconway:neilc/fix-spark-format-string
Open

fix: Panic in Spark's format_string for illegal characters#22077
neilconway wants to merge 1 commit intoapache:mainfrom
neilconway:neilc/fix-spark-format-string

Conversation

@neilconway
Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Rationale for this change

format_string("%c") in datafusion-spark calls char::from_u32.unwrap() without checking for a None return, which leads to panicking on invalid inputs (e.g., negative values and illegal Unicode codepoints).

What changes are included in this PR?

  • Add error handling for format_string("%c")
  • Rust unit tests
  • SLT end-to-end test

Are these changes tested?

Yes.

Are there any user-facing changes?

No.

@github-actions github-actions Bot added sqllogictest SQL Logic Tests (.slt) spark labels May 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

spark sqllogictest SQL Logic Tests (.slt)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Panic in Spark's format_string

1 participant