[
https://issues.apache.org/jira/browse/CALCITE-6620?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17888110#comment-17888110
]
Julian Hyde edited comment on CALCITE-6620 at 10/15/24 3:54 AM:
----------------------------------------------------------------
Fixed by
[052a5f8|https://github.com/apache/calcite/commit/052a5f8bf8abc12d0804071982b36189067c4453].
(Revised, adding test cases, in
[a7c3d16|https://github.com/apache/calcite/commit/a7c3d166b3d6ef614f23320ecd00d855ced1f302].)
Thank you for the reviews [~rubenql], [~julianhyde], [~suibianwanwan3333],
[~nobigo].
was (Author: JIRAUSER295926):
Fixed by
https://github.com/apache/calcite/commit/052a5f8bf8abc12d0804071982b36189067c4453
Thank you for the reviews [~rubenql][~julianhyde][~suibianwanwan3333][~nobigo]
> VALUES created by RelBuilder do not have a homogeneous type
> -----------------------------------------------------------
>
> Key: CALCITE-6620
> URL: https://issues.apache.org/jira/browse/CALCITE-6620
> Project: Calcite
> Issue Type: Bug
> Components: core
> Affects Versions: 1.37.0
> Reporter: Mihai Budiu
> Assignee: Mihai Budiu
> Priority: Minor
> Labels: pull-request-available
> Fix For: 1.38.0
>
>
> This is a left-over issue from [CALCITE-6617]
> A reproduction is the following test that can be added to SqlOperatorTest.
> This reproduction was created by [~rubenql].
> {code:java}
> @Test void differentTypeValues() {
> CalciteAssert.that()
> .with(CalciteConnectionProperty.LEX, Lex.JAVA)
> .with(CalciteConnectionProperty.FORCE_DECORRELATE, false)
> .withSchema("s", new ReflectiveSchema(new HrSchema()))
> .query("SELECT * FROM (VALUES (1, 2, 3), (CAST(5E0 AS REAL), 5E0,
> NULL))")
> .explainContains("PLAN=EnumerableValues(tuples=[[{ 1.0E0, 2.0E0, 3 },
> "
> + "{ 5.0E0, 5.0E0, null }]])")
> .returnsOrdered("EXPR$0=1.0; EXPR$1=2.0; EXPR$2=3", "EXPR$0=5.0;
> EXPR$1=5.0; EXPR$2=null");
> }
> {code}
> The underlying problem is the fact that RelBuilder can create an instance of
> LogicalValues with multiple "rows" where each row has a different type.
> Although RelBuilder computes the unifying type, this type is actually never
> used in the construction of the LogicalValues to cast the literals that form
> the Values.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)