You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Chunwei Lei (Jira)" <ji...@apache.org> on 2022/06/06 02:08:00 UTC
[jira] [Comment Edited] (CALCITE-5179) AssertionError in values with more than two items when SqlDialect#supportsAliasedValues is false
[ https://issues.apache.org/jira/browse/CALCITE-5179?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17550261#comment-17550261 ]
Chunwei Lei edited comment on CALCITE-5179 at 6/6/22 2:07 AM:
--------------------------------------------------------------
IMOP, it would be great if the title can specify the error appears when converting rel node to sql.
was (Author: chunwei lei):
IMOP, it would be great if the error appears when converting rel node to sql.
> AssertionError in values with more than two items when SqlDialect#supportsAliasedValues is false
> ------------------------------------------------------------------------------------------------
>
> Key: CALCITE-5179
> URL: https://issues.apache.org/jira/browse/CALCITE-5179
> Project: Calcite
> Issue Type: Bug
> Reporter: Steven Talbot
> Assignee: Jiajun Xie
> Priority: Major
> Labels: pull-request-available
> Time Spent: 10m
> Remaining Estimate: 0h
>
> The code at [https://github.com/apache/calcite/blob/4b349032c17b95735b12593a65f7027d54d8b8b6/core/src/main/java/org/apache/calcite/rel/rel2sql/RelToSqlConverter.java#L802-L803] creates a UNION ALL with an arbitrary number of operands, but [the UNION_ALL operator is a SqlSetOperator|https://github.com/apache/calcite/blob/4b349032c17b95735b12593a65f7027d54d8b8b6/core/src/main/java/org/apache/calcite/sql/fun/SqlStdOperatorTable.java#L108-L109] which is a "SqlBinaryOperator" (Binary syntax). So that generates an assertion error when it unparses more than two values at [https://github.com/apache/calcite/blob/4b349032c17b95735b12593a65f7027d54d8b8b6/core/src/main/java/org/apache/calcite/sql/SqlUtil.java#L426]
>
> I don't _think_ I've done anything nonstandard, other than use a dialect with that flag set to false. To reproduce, create a values RelNode with more than two items, convert it with RelToSqlConverter with a dialect using supportsAliasedValues() = false (like Redshift), and attempt to unparse the resulting SqlNode.
--
This message was sent by Atlassian Jira
(v8.20.7#820007)