[CALCITE-7599] Enhance parser to allow numeric literals as values in k/v hints as suggested by documentation#5012
Open
chrisdennis wants to merge 1 commit into
Open
[CALCITE-7599] Enhance parser to allow numeric literals as values in k/v hints as suggested by documentation#5012chrisdennis wants to merge 1 commit into
chrisdennis wants to merge 1 commit into
Conversation
Contributor
Author
|
In the process of cleaning some test fallout here... right now I don't think this impacts the actual fix however. |
19f2ab9 to
c6fb85c
Compare
mihaibudiu
reviewed
Jun 11, 2026
| + "empno, ename, deptno from emps"; | ||
| sql(sql1).fails("(?s).*Encountered \"k1 = 123\" at .*"); | ||
| // Allow numeric literal k/v values. | ||
| final String expected1 = "SELECT\n" |
Contributor
There was a problem hiding this comment.
Do you want to add a few more tests with the more complex numeric literals supported, e.g. 1e-2?
Contributor
Author
There was a problem hiding this comment.
That would make sense, but I'll add them to SqlHintsConverterTest rather than here.
…k/v hints as suggested by documentation Signed-off-by: Chris Dennis <chris.w.dennis@gmail.com>
c6fb85c to
9f0a739
Compare
|
mihaibudiu
reviewed
Jun 13, 2026
| //~ Tools ------------------------------------------------------------------ | ||
|
|
||
| private static String getOptionAsString(SqlNode node) { | ||
| private String getOptionAsString(SqlNode node) { |
Contributor
Author
There was a problem hiding this comment.
So that we can reference options in the requireNonNull message.
mihaibudiu
approved these changes
Jun 14, 2026
Contributor
|
Let's see if there are other comments before merging. |
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.



CALCITE-7599
This is a small refinement to CALCITE-7498 to finish alignment of the reference documentation example, the reference documentation grammar, and the actual parser grammar. The alignment here could have used a different fixed point, but I figured I would follow the original example and align on the example query as the source of truth. This also has the nice side-effect of supporting the largest set of valid hints.