[ 
https://issues.apache.org/jira/browse/CALCITE-6651?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Mihai Budiu resolved CALCITE-6651.
----------------------------------
    Fix Version/s: 1.39.0
       Resolution: Fixed

Fixed in 
https://github.com/apache/calcite/commit/40cadca10d832d348b6b0a14229a1d0e74f0c1c1
Thank you for the contribution [~suibianwanwan33]
Thank you for the review [~caicancai]

> 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
>             Fix For: 1.39.0
>
>
> In RelToSqlConverter, some unions are created using LogicalUnion.create() and 
> some are relBuilder.union(). In RelBuilder.union we configure simplifyValues 
> to control whether or not the {_}Union(Project(Values))} to{_}{*}_{@code_{*} 
> _Values}._
> {code:java}
> /** Whether to simplify {@code Union(Values, Values)} or
>  * {@code Union(Project(Values))} to {@code Values}; default true. */
> @Value.Default default boolean simplifyValues() {
>   return true;
> }{code}
> This will cause the configuration to not take effect where 
> LogicalUnion.create() is called.
> For example:
> {code:java}
> select * from (select 'word' i union all select 'w' i) 
> {code}
> Result:
> {code:java}
> LogicalUnion(all=[true])
>    LogicalValues(tuples=[[{ 'word' }]])
>    LogicalValues(tuples=[[{ 'w   ' }]])
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to