[
https://issues.apache.org/jira/browse/CALCITE-6651?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17896128#comment-17896128
]
xiong duan commented on CALCITE-6651:
-------------------------------------
The description is not very clear, maybe needs more detailed information.
> Use RelBuilder in SqlToRelConverter to construct Union
> ------------------------------------------------------
>
> Key: CALCITE-6651
> URL: https://issues.apache.org/jira/browse/CALCITE-6651
> Project: Calcite
> Issue Type: Bug
> Reporter: suibianwanwan
> Assignee: suibianwanwan
> Priority: Major
> Labels: pull-request-available
>
> In SqlToRelConverter, one part of Union is constructed by LogicalUnion.create
> and another part is created by relBuilder. And relBuilder.union will be based
> on RelBuilder.Config to determine whether the value needs to be simplify. but
> LogicalUnion.create will not. But LogicalUnion.create won't. This results in
> some values created by LogicalUnion.create not being simplified.
> For example: In SqlToRelConverterTest: (This example may have some overlap
> with CALCITE-6350)
> {code:java}
> @Test void testUnionChar() {
> final String sql = "select 'a' t1 union SELECT 'ab' t1";
> sql(sql).ok();
> } {code}
> Result:
> {code:java}
> LogicalUnion(all=[false])
> LogicalValues(tuples=[[{ 'a' }]])
> LogicalValues(tuples=[[{ 'ab' }]])
> {code}
> Expected result:
> {code:java}
> LogicalUnion(all=[false])
> LogicalValues(tuples=[[{ 'a ' }]])
> LogicalValues(tuples=[[{ 'ab' }]])
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)