Aleksey Plekhanov created IGNITE-20353:
------------------------------------------

             Summary: Calcite engine. Clause 'WITH affinity_key=...' silently 
ignored when wrong column is specified
                 Key: IGNITE-20353
                 URL: https://issues.apache.org/jira/browse/IGNITE-20353
             Project: Ignite
          Issue Type: Bug
            Reporter: Aleksey Plekhanov
            Assignee: Aleksey Plekhanov


Calcite-based SQL engine silently ignore clause WITH affinity_key=... when 
wrong column is specified. H2-based engine in this case throw an error: 
{noformat}
org.apache.ignite.internal.processors.query.IgniteSQLException: Affinity key 
column with given name not found: test
{noformat}

Reproducer:
{code:sql}
CREATE TABLE order_items (id varchar, orderId int, sku varchar, PRIMARY KEY 
(id, orderId) WITH "affinity_key=test");
{code}

Also, there is some problem with case-sensitivity, for example:
{code:sql}
CREATE TABLE order_items (id varchar, orderId int, sku varchar, PRIMARY KEY 
(id, orderId) WITH "affinity_key=orderId");
{code}
Works well for H2-based engine ({{orderId}} in {{affinity_key}} converted to 
{{ORDERID}} and matches {{orderId}} columns alias), but silently ignired for 
Calcite-based engine ({{orderId}} in {{affinity_key}} remains without case 
change). But:
{code:sql}
CREATE TABLE order_items (id varchar, orderId int, sku varchar, PRIMARY KEY 
(id, orderId) WITH "affinity_key=ORDERID");
{code}
Works well for both engines.




--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to