Skip to content

[SPARK-56859][SQL] Create user error for IllegalArgumentException in CSVOptions#55877

Closed
shivadarshan-devadiga wants to merge 5 commits into
apache:masterfrom
shivadarshan-devadiga:cveoptions-user-error
Closed

[SPARK-56859][SQL] Create user error for IllegalArgumentException in CSVOptions#55877
shivadarshan-devadiga wants to merge 5 commits into
apache:masterfrom
shivadarshan-devadiga:cveoptions-user-error

Conversation

@shivadarshan-devadiga
Copy link
Copy Markdown
Contributor

@shivadarshan-devadiga shivadarshan-devadiga commented May 14, 2026

What changes were proposed in this pull request?

This PR converts IllegalArgumentException thrown by require() statements in CSVOptions to proper user-facing Spark errors with error classes

Why are the changes needed?

Currently, CSVOptions uses Scala's require() which throws generic IllegalArgumentException with plain text messages. This change aligns lineSep validation with Spark's error handling standards, making errors more actionable and consistent.

Does this PR introduce any user-facing change?

Yes. The error messages for invalid lineSep values will change

How was this patch tested?

All SQL related tests were run including the linsep tests

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

No

cc: @markj-db @MaxGekk @HyukjinKwon

@shivadarshan-devadiga
Copy link
Copy Markdown
Contributor Author

@HyukjinKwon The CI pipeline is green now, have made few changes to the test cases; Can you please review it and merge. Thank you

@shivadarshan-devadiga
Copy link
Copy Markdown
Contributor Author

Gentle ping @HyukjinKwon

@HyukjinKwon
Copy link
Copy Markdown
Member

sorry I saw it now. merging

@HyukjinKwon
Copy link
Copy Markdown
Member

Merged to master and branch-4.x.

HyukjinKwon pushed a commit that referenced this pull request May 20, 2026
…CSVOptions

### What changes were proposed in this pull request?
This PR converts IllegalArgumentException thrown by require() statements in CSVOptions to proper user-facing Spark errors with error classes

### Why are the changes needed?
Currently, CSVOptions uses Scala's require() which throws generic IllegalArgumentException with plain text messages. This change aligns lineSep validation with Spark's error handling standards, making errors more actionable and consistent.

### Does this PR introduce _any_ user-facing change?
Yes. The error messages for invalid lineSep values will change

### How was this patch tested?
All SQL related tests were run including the linsep tests

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

cc: markj-db MaxGekk HyukjinKwon

Closes #55877 from shivadarshan-devadiga/cveoptions-user-error.

Authored-by: Shivadarshan Devadiga <shivadarshan2212@gmail.com>
Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
(cherry picked from commit e3c519e)
Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
@shivadarshan-devadiga
Copy link
Copy Markdown
Contributor Author

Thank you @HyukjinKwon

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.

2 participants