Repository navigation
[CALCITE-5948] Use explicit casting if element type in ARRAY/MAP does not equal derived component type #3395
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 |
|---|---|---|
|
|
@@ -8144,10 +8144,9 @@ private void checkGetTimestamp(Connection con) throws SQLException { | |
| * ClassCastException retrieving from ARRAY that has mixed INTEGER and DECIMAL | ||
| * elements</a>. */ | ||
| @Test void testIntAndBigDecimalInArray() { | ||
| // Result should be "EXPR$0=[1, 1.1]\n"; [CALCITE-4850] logged. | ||
| CalciteAssert.that() | ||
| .query("select array[1, 1.1]") | ||
| .returns("EXPR$0=[0E+1, 1.1]\n"); | ||
|
Member
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. @tanclary thanks for patient reviewing! btw, I think we can safely close CALCITE-4850. The result has been corrected. |
||
| .returns("EXPR$0=[1, 1.1]\n"); | ||
| } | ||
|
|
||
| /** Test case for | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2179,12 +2179,12 @@ select array[1,null,2] as a from (values (1)); | |
|
|
||
| values array['a',null,'bcd'], | ||
| array['efgh']; | ||
| +----------------+ | ||
| | EXPR$0 | | ||
| +----------------+ | ||
| | [a, null, bcd] | | ||
| | [efgh] | | ||
| +----------------+ | ||
| +------------------+ | ||
| | EXPR$0 | | ||
| +------------------+ | ||
| | [a , null, bcd] | | ||
|
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. Why is there an extra space?
Member
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. @JiajunBernoulli thanks for reviewing. this is a import change in this PR. if we have This is calcite and sql standard limitation. Of course, this does look weird, actually calcite has other ways to remove spaces. We can activate More details can be found in javadoc https://github.com/apache/calcite/blob/d9dd3ac8a9f695e111a0a5e77f45b61b90f4b5b6/core/src/main/java/org/apache/calcite/sql/validate/SqlConformance.java#L465C7-L465C7 I also have added some cases in the PR to show this difference.
Member
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. @JiajunBernoulli hi, Jiajun. If you have time, could you help to review it again? thanks
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. Ok, Thank you for your clear explanation. |
||
| | [efgh] | | ||
| +------------------+ | ||
| (2 rows) | ||
|
|
||
| !ok | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.