[
https://issues.apache.org/jira/browse/IGNITE-16322?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Taras Ledkov updated IGNITE-16322:
----------------------------------
Description:
Examples fail with NPE because table with the specified name does not exist.
The actual table name is PUBLIC.ACCOUNTS (all uppercase), same for column names
- ACCOUNTNUMBER and so on.
*Proposed Fix*
Use case insensitive collation to compare and lookup database object.
e.g.
{{CREATE TABLE MyTable (id INT, val INT)}}; -> creates PUBLIC.MYTABLE
{{ignite.tables().table("public.mytable");}} -> return PUBLIC.MYTABLE
{{CREATE TABLE \"MyTable\" (id INT, val INT)}}; -> fails with error:
PUBLIC.MYTABLE already exists,
Implementation steps :
- DB object config named lists use upper case for keys.
- all builders from {{SchemaBuilders}}
- All tuple implementation parse column (field) name and change case for
unquoted.
- All implementation of the {{Mapper}} interface parse column name and change
case for unquoted.
was:
Examples fail with NPE because table with the specified name does not exist.
The actual table name is PUBLIC.ACCOUNTS (all uppercase), same for column names
- ACCOUNTNUMBER and so on.
*Temporary fix proposal*
Public API will be use quoted names of the DB object to prevent conversion a
name to upper case.
It will be applied for:
- {{IgniteTables}} methods for table name, e.g.
{{createTable("\"PUBLIC\".\"MyTable\"", ...)}}
- all builders from {{SchemaBuilders}}
- All tuple implementation parse column (field) name and change case for
unquoted.
- All implementation of the {{Mapper}} interface parse column name and change
case for unquoted.
> Database object names case inconsisten between SQL and KV API
> -------------------------------------------------------------
>
> Key: IGNITE-16322
> URL: https://issues.apache.org/jira/browse/IGNITE-16322
> Project: Ignite
> Issue Type: Bug
> Components: sql
> Affects Versions: 3.0.0-alpha3
> Reporter: Taras Ledkov
> Assignee: Taras Ledkov
> Priority: Major
> Labels: ignite-3
> Fix For: 3.0.0-alpha4
>
> Time Spent: 10m
> Remaining Estimate: 0h
>
> Examples fail with NPE because table with the specified name does not exist.
> The actual table name is PUBLIC.ACCOUNTS (all uppercase), same for column
> names - ACCOUNTNUMBER and so on.
> *Proposed Fix*
> Use case insensitive collation to compare and lookup database object.
> e.g.
> {{CREATE TABLE MyTable (id INT, val INT)}}; -> creates PUBLIC.MYTABLE
> {{ignite.tables().table("public.mytable");}} -> return PUBLIC.MYTABLE
> {{CREATE TABLE \"MyTable\" (id INT, val INT)}}; -> fails with error:
> PUBLIC.MYTABLE already exists,
> Implementation steps :
> - DB object config named lists use upper case for keys.
> - all builders from {{SchemaBuilders}}
> - All tuple implementation parse column (field) name and change case for
> unquoted.
> - All implementation of the {{Mapper}} interface parse column name and change
> case for unquoted.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)