-
Notifications
You must be signed in to change notification settings - Fork 2.5k
[CALCITE-7724] SqlUtil#lookupSubjectRoutines rejects a valid operator… #5187
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1025,6 +1025,30 @@ void testDyadicCollateOperator() { | |
| .fails("Parameters must be of the same type"); | ||
| } | ||
|
|
||
| /** Test case for <a href="https://issues.apache.org/jira/browse/CALCITE-7724"> | ||
| * [CALCITE-7724] SqlUtil#lookupSubjectRoutines rejects a valid operator when its | ||
| * SqlKind is remapped by SqlKind#getFunctionKind() and two operator-table entries | ||
| * resolve to it</a>. | ||
| * | ||
| * <p>The kind-based fourth pass in {@code filterOperatorRoutinesByKind} maps only | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not sure how useful this paragraph is.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've tried to keep it short and be clear. Two competing goals. Are you okay with the comments as they are or do you have a preferred change? |
||
| * the candidate's kind through {@code getFunctionKind()}, not the call's own kind - | ||
| * so an operator whose kind is remapped (e.g. {@link SqlKind#POSITION}) can fail to | ||
| * match itself once a second candidate for the same name exists. */ | ||
| @Test void testFunctionKindMismatchWithDuplicateOperatorTableEntry() { | ||
| // Chaining the operator table with itself ensures that each appears twice. | ||
| final SqlOperatorTable duplicated = | ||
| SqlOperatorTables.chain(SqlStdOperatorTable.instance(), SqlStdOperatorTable.instance()); | ||
| expr("position('mouse' in 'house')") | ||
| .withOperatorTable(duplicated) | ||
| .ok(); | ||
| expr("char_length('string')") | ||
| .withOperatorTable(duplicated) | ||
| .ok(); | ||
| expr("character_length('string')") | ||
| .withOperatorTable(duplicated) | ||
| .ok(); | ||
| } | ||
|
|
||
| @Test void testTrim() { | ||
| expr("trim('mustache' FROM 'beard')").ok(); | ||
| expr("trim(both 'mustache' FROM 'beard')").ok(); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this comment is too long; please do not submit useless comments, they will take time from reviewers now and forever when they will be read
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack