You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Danny Chan (JIRA)" <ji...@apache.org> on 2019/07/18 10:22:00 UTC
[jira] [Updated] (CALCITE-3201) SqlValidator throws exception for
sql insert target table with virtual columns
[ https://issues.apache.org/jira/browse/CALCITE-3201?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Danny Chan updated CALCITE-3201:
--------------------------------
Summary: SqlValidator throws exception for sql insert target table with virtual columns (was: Skip validation for sql insert columns with column strategy that can not insert into)
> SqlValidator throws exception for sql insert target table with virtual columns
> ------------------------------------------------------------------------------
>
> Key: CALCITE-3201
> URL: https://issues.apache.org/jira/browse/CALCITE-3201
> Project: Calcite
> Issue Type: Improvement
> Components: core
> Affects Versions: 1.20.0
> Reporter: Danny Chan
> Assignee: Danny Chan
> Priority: Major
> Fix For: 1.21.0
>
>
> Now if we have a target table with schema:
> {code:sql}
> t1
> : - a int not null
> - b bigint STORED
> - c varchar VIRTUAL
> {code}
> and validate a query like:
> {code:sql}
> insert into t1 select a from t1;
> {code}
> It would throw exception because the target table fields count is 3 but the query is 1,
> actually the table t1 columns b and c have strategy that we can not insert into, so we better
> ignore these columns when do validation.
> The following query in SQLSERVER-2017 passed:
> {code:sql}
> create table t(
> a int,
> b int,
> c as a+2
> );
> -- insert into t values(1, 2, 3) fails with non-equal schema fields count.
> insert into t values(1, 2);
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.14#76016)