[ 
https://issues.apache.org/jira/browse/CALCITE-1510?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15812716#comment-15812716
 ] 

Julian Hyde commented on CALCITE-1510:
--------------------------------------

I don't think we should weaken the relational algebra ({{Values}} or 
{{TableModificationRel}}). If the table has N columns then the relation going 
into it must have N columns. It is to everyone's benefit to keep the relational 
algebra very strict.

You should change the validator to allow fewer columns if (a) the conformance 
enables it and (b) the omitted columns are nullable or have default values. 
Then change the sql-to-rel converter to supply the default values: so {{INSERT 
INTO t (x) VALUES (1)}} has a very similar effect to {{INSERT INTO t (x, y, z) 
VALUES (1, DEFAULT, DEFAULT)}}.

And we will need tests (mostly in SqlValidatorTest).

> INSERT/UPSERT should allow values less than number of columns
> -------------------------------------------------------------
>
>                 Key: CALCITE-1510
>                 URL: https://issues.apache.org/jira/browse/CALCITE-1510
>             Project: Calcite
>          Issue Type: Improvement
>            Reporter: Rajeshbabu Chintaguntla
>            Assignee: Julian Hyde
>         Attachments: CALCITE-1510.patch
>
>
> Currently calcite not allowing to write if the values less than number of 
> columns. We can write the leading columns with the all values and remaining 
> columns can be considered as null or else we can allow specifying columns and 
> corresponding values. Ping [~julianhyde] [~jamestaylor] [~maryannxue].



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to