Skip to content

[CALCITE-7731] Bound plain-notation expansion of DECIMAL literals to prevent parse-time OutOfMemoryError (follow-up, added more tests) - #5212

Merged
rubenada merged 1 commit into
apache:mainfrom
skrcode:calcite-7731-tests
Aug 25, 2026
Merged

Conversation

@skrcode

@skrcode skrcode commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #5204, requested by @rubenada in #5204 (comment).

This adds direct regression tests for the three CALCITE-7731 plain-notation guards outside the parser path:

  • RexBuilder.makeLiteral with a dialect-permitted negative DECIMAL scale
  • Rel-to-SQL conversion of an oversized exact DECIMAL literal
  • SqlNumericLiteral.toValue for a directly constructed literal

Each test uses a bounded input of roughly 20,000 digits and verifies the specific guard exception. No production code changes are included.

Validation on current main with Java 21 and the pinned Gradle 8.14.4 wrapper:

  • focused new tests: 3 passed, 0 failed
  • RelToSqlConverterTest: 623 passed, 0 failed
  • RexBuilderTest: 72 passed, 0 failed
  • SqlNodeTest: 4 passed, 0 failed
  • core Checkstyle and AutoStyle: passed
  • :core:build: 16,658 completed, 0 failed, 155 skipped
  • repository-wide build: BUILD SUCCESSFUL, 413 tasks

The initial missing cases were identified by JAIPilot Cloud, then rebased, reviewed, and independently validated against the latest upstream main.

@rubenada

Copy link
Copy Markdown
Contributor

@skrcode thanks for the patch! LGTM
Could you please squash commits into a single one? As final commit message I'd propose something like: [CALCITE-7731] Bound plain-notation expansion of DECIMAL literals to prevent parse-time OutOfMemoryError (follow-up, added more tests)

…prevent parse-time OutOfMemoryError (follow-up, added more tests)
@skrcode
skrcode force-pushed the calcite-7731-tests branch from d47bbf3 to d905242 Compare August 24, 2026 09:51
@sonarqubecloud

Copy link
Copy Markdown

@rubenada rubenada added the LGTM-will-merge-soon Overall PR looks OK. Only minor things left. label Aug 24, 2026
@rubenada rubenada changed the title [CALCITE-7731] Add coverage for DECIMAL plain-notation guards [CALCITE-7731] Bound plain-notation expansion of DECIMAL literals to prevent parse-time OutOfMemoryError (follow-up, added more tests) Aug 25, 2026
@rubenada
rubenada merged commit 5e3326a into apache:main Aug 25, 2026
35 checks passed
@rubenada

Copy link
Copy Markdown
Contributor

Thanks for the patch @skrcode

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

LGTM-will-merge-soon Overall PR looks OK. Only minor things left.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants