Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Add concrete exceptions when parsing strings to timestamps in ANSI mode #5355

Open
res-life opened this issue Apr 28, 2022 · 0 comments
Labels
bug Something isn't working P1 Nice to have for release

Comments

@res-life
Copy link
Collaborator

Describe the bug
Gpu now throws an IllegalArgumentException when parsing strings to timestamps in ANSI mode:

// datetimeExpressions.scala
        // CPU may throw `DateTimeParseException`, `DateTimeException` or `ParseException`
        throw new IllegalArgumentException("Exception occurred when parsing timestamp in ANSI mode")

Spark throws more concrete exceptions:

// in `ToTimestamp` 
            } catch {
              case e: DateTimeParseException if failOnError =>
                throw QueryExecutionErrors.ansiDateTimeParseError(e)
              case e: DateTimeException if failOnError =>
                throw QueryExecutionErrors.ansiDateTimeError(e)
              case e: ParseException if failOnError =>
                throw QueryExecutionErrors.ansiParseError(e)
              case e if isParseError(e) => null
            }

Adding concrete exceptions as Spark does will make the error message more readable.
The priority is low.

It's from: #5316 (comment)

@res-life res-life added bug Something isn't working ? - Needs Triage Need team to review and classify P1 Nice to have for release labels Apr 28, 2022
@sameerz sameerz removed the ? - Needs Triage Need team to review and classify label May 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P1 Nice to have for release
Projects
None yet
Development

No branches or pull requests

2 participants