[
https://issues.apache.org/jira/browse/IGNITE-19096?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Maksim Zhuravkov updated IGNITE-19096:
--------------------------------------
Description:
It is possible to remove default placeholders altogether and insert default
value s for columns at the sql to relnode conversion phase.
*Note*
A) In order to avoid code duplication use
TableDescriptorImpl::newColumnDefaultValue.
B) Calcite generates different RelNode trees for queries INSERT INTO tmp (a)
VALUES (1) and INSERT INTO tmp (a, b) VALUES (1, DEFAULT). For the first query
calcite supplies DEFAULT values by calling
TableDescriptorImpl::newColumnDefaultValue, but for the second query it does
not do it.
C) Since sql operator in Calcite can contain only literals, plans for INSERT
statements for tables with implicit primary key and without it are different.
When a table has an implicit primary key, Calcite adds a projection operator
with a call to gen_random_uuid() and uses values operator as input of that
projection.
was:
It is possible to remove default placeholders altogether and insert default
value s for columns at the sql to relnode conversion phase.
*Note*
A) In order to avoid code duplication use
TableDescriptorImpl::newColumnDefaultValue.
B) Calcite generates different RelNode trees for queries INSERT INTO tmp (a)
VALUES (1) and INSERT INTO tmp (a, b) VALUES (1, DEFAULT). For the first query
calcite supplies DEFAULT values by calling
TableDescriptorImpl::newColumnDefaultValue, but for the second query it does
not do it.
> Sql. Remove code that replaces placeholder values from ModifyNode.
> ------------------------------------------------------------------
>
> Key: IGNITE-19096
> URL: https://issues.apache.org/jira/browse/IGNITE-19096
> Project: Ignite
> Issue Type: Improvement
> Components: sql
> Reporter: Maksim Zhuravkov
> Priority: Minor
> Labels: calcite2-required, calcite3-required, ignite-3
> Fix For: 3.0.0-beta2
>
>
> It is possible to remove default placeholders altogether and insert default
> value s for columns at the sql to relnode conversion phase.
> *Note*
> A) In order to avoid code duplication use
> TableDescriptorImpl::newColumnDefaultValue.
> B) Calcite generates different RelNode trees for queries INSERT INTO tmp (a)
> VALUES (1) and INSERT INTO tmp (a, b) VALUES (1, DEFAULT). For the first
> query calcite supplies DEFAULT values by calling
> TableDescriptorImpl::newColumnDefaultValue, but for the second query it does
> not do it.
> C) Since sql operator in Calcite can contain only literals, plans for INSERT
> statements for tables with implicit primary key and without it are different.
> When a table has an implicit primary key, Calcite adds a projection operator
> with a call to gen_random_uuid() and uses values operator as input of that
> projection.
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)