Repository navigation
Spark: Parse negative numeric literals before casts - #3069
Open
benjibunbun wants to merge 1 commit into
Open
benjibunbun wants to merge 1 commit into
benjibunbun wants to merge 1 commit into
Conversation
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.
Dialects: Spark
Fixes #3055.
SELECT -128::TINYINTnow casts the negative literal instead of negating a cast of positive128, which overflowsTINYINT.Spark now treats a leading minus as part of a numeric literal, matching its number grammar. Nonliteral unary minus, unary plus and other dialects retain their existing grouping.
Added AST assertions for integer boundaries, numeric forms, spans, preserved operators, errors and round trips, plus a minimal fuzz seed.
Local checks passed on macOS: default tests, stable/beta/nightly all-feature tests, fmt, Clippy, docs, no_std, RAT and coverage. Changed executable lines have 100% coverage. Parser and display/reparse fuzz runs completed over 210,000 inputs without reported failures.
Assisted by Codex.