You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Julian Hyde (Jira)" <ji...@apache.org> on 2022/10/26 18:39:00 UTC
[jira] [Comment Edited] (CALCITE-4923) Expand "star" for NATURAL JOIN fails if some columns are filtered out by addToSelectList
[ https://issues.apache.org/jira/browse/CALCITE-4923?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17624681#comment-17624681 ]
Julian Hyde edited comment on CALCITE-4923 at 10/26/22 6:38 PM:
----------------------------------------------------------------
[~alex_pl] wrote:
{quote}
SqlValidatorImpl.expandStar() method is private now. Can we make it protected?
{quote}
I don't think that's a sustainable solution.
[~vilo], Given that you and [~alex_pl] have the same requirement, a sustainable solution would seem to be to implement "Extensible system columns" as a Calcite feature. What do you think?
was (Author: julianhyde):
{quote}
SqlValidatorImpl.expandStar() method is private now. Can we make it protected?
{quote}
I don't think that's a sustainable solution.
> Expand "star" for NATURAL JOIN fails if some columns are filtered out by addToSelectList
> ----------------------------------------------------------------------------------------
>
> Key: CALCITE-4923
> URL: https://issues.apache.org/jira/browse/CALCITE-4923
> Project: Calcite
> Issue Type: Bug
> Reporter: Aleksey Plekhanov
> Priority: Major
>
> If all columns ("*") are requested and some table columns are filtered out by overridden {{SqlValidatorImpl.addToSelectList()}} method (for example, some system columns, which we don't want to show to user until it explicitly requests it) query with NATURAL JOIN and JOIN with USING fail on {{SqlValidatorImpl.expandStar()}} with error:
> {noformat}
> java.lang.ArrayIndexOutOfBoundsException: 7
> at com.google.common.collect.RegularImmutableList.get(RegularImmutableList.java:60)
> at org.apache.calcite.sql.validate.SqlValidatorImpl$Permute.permute(SqlValidatorImpl.java:7109)
> at org.apache.calcite.sql.validate.SqlValidatorImpl.expandStar(SqlValidatorImpl.java:664)
> at org.apache.calcite.sql.validate.SqlValidatorImpl.expandSelectItem(SqlValidatorImpl.java:426)
> at org.apache.calcite.sql.validate.SqlValidatorImpl.validateSelectList(SqlValidatorImpl.java:4409)
> at org.apache.calcite.sql.validate.SqlValidatorImpl.validateSelect(SqlValidatorImpl.java:3652)
> {noformat}
> Because {{Permute.permute()}} rely on columns count equality in {{selectItems}} and JOIN row type.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)