ignite-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vyacheslav Koptilin (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (IGNITE-7277) JDBC thin driver may list table name twice.
Date Thu, 21 Dec 2017 10:40:00 GMT

     [ https://issues.apache.org/jira/browse/IGNITE-7277?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Vyacheslav Koptilin updated IGNITE-7277:
----------------------------------------
    Description: 
JDBC thin driver duplicates table name in case of using {{CacheConfiguration.setIndexedTypes()}}

{code}
    CacheConfiguration<?, ?> cfg = new CacheConfiguration<>("CACHE_NAME").setSqlSchema("PUBLIC");
    cfg.setIndexedTypes(Long.class, Person.class);
    IgniteCache<?, ?> cachePerson = ignite.getOrCreateCache(cfg);
{code}

{code:title=sqlline output|borderStyle=solid}
+--------------------------------+--------------------------------+--------------------------------+--------------------------------+
|           TABLE_CAT            |          TABLE_SCHEM           |           TABLE_NAME 
         |           TABLE_TYPE           |
+--------------------------------+--------------------------------+--------------------------------+--------------------------------+
|                                | PUBLIC                         | CITY                 
         | TABLE                          |
|                                | CACHE_NAME                     | PERSON               
         | TABLE                          |
|                                | CACHE_NAME                     | PERSON               
         | TABLE                          |
+--------------------------------+--------------------------------+--------------------------------+--------------------------------+
{code}

On the other hand, the following approach to create a table works as expected
{code}
    cache.query(new SqlFieldsQuery(
                "CREATE TABLE city (id LONG PRIMARY KEY, name VARCHAR) WITH \"template=partitioned\""));
{code}

  was:
JDBC thin driver duplicates table name in case of using {{CacheConfiguration.setIndexedTypes()}}

{{
CacheConfiguration<?, ?> cfg = new CacheConfiguration<>("CACHE_NAME").setSqlSchema("PUBLIC");
cfg.setIndexedTypes(Long.class, Person.class);
IgniteCache<?, ?> cachePerson = ignite.getOrCreateCache(cfg);
}}

{{sqlline}} output
{{
+--------------------------------+--------------------------------+--------------------------------+--------------------------------+
|           TABLE_CAT            |          TABLE_SCHEM           |           TABLE_NAME 
         |           TABLE_TYPE           |
+--------------------------------+--------------------------------+--------------------------------+--------------------------------+
|                                | PUBLIC                         | CITY                 
         | TABLE                          |
|                                | CACHE_NAME                     | PERSON               
         | TABLE                          |
|                                | CACHE_NAME                     | PERSON               
         | TABLE                          |
+--------------------------------+--------------------------------+--------------------------------+--------------------------------+
}}

On the other hand, the following approach to create a table works as expected
{{
cache.query(new SqlFieldsQuery(
                "CREATE TABLE city (id LONG PRIMARY KEY, name VARCHAR) WITH \"template=partitioned\""));
}}


> JDBC thin driver may list table name twice.
> -------------------------------------------
>
>                 Key: IGNITE-7277
>                 URL: https://issues.apache.org/jira/browse/IGNITE-7277
>             Project: Ignite
>          Issue Type: Bug
>          Components: jdbc, sql
>    Affects Versions: 2.3
>            Reporter: Vyacheslav Koptilin
>            Assignee: Taras Ledkov
>
> JDBC thin driver duplicates table name in case of using {{CacheConfiguration.setIndexedTypes()}}
> {code}
>     CacheConfiguration<?, ?> cfg = new CacheConfiguration<>("CACHE_NAME").setSqlSchema("PUBLIC");
>     cfg.setIndexedTypes(Long.class, Person.class);
>     IgniteCache<?, ?> cachePerson = ignite.getOrCreateCache(cfg);
> {code}
> {code:title=sqlline output|borderStyle=solid}
> +--------------------------------+--------------------------------+--------------------------------+--------------------------------+
> |           TABLE_CAT            |          TABLE_SCHEM           |           TABLE_NAME
          |           TABLE_TYPE           |
> +--------------------------------+--------------------------------+--------------------------------+--------------------------------+
> |                                | PUBLIC                         | CITY            
              | TABLE                          |
> |                                | CACHE_NAME                     | PERSON          
              | TABLE                          |
> |                                | CACHE_NAME                     | PERSON          
              | TABLE                          |
> +--------------------------------+--------------------------------+--------------------------------+--------------------------------+
> {code}
> On the other hand, the following approach to create a table works as expected
> {code}
>     cache.query(new SqlFieldsQuery(
>                 "CREATE TABLE city (id LONG PRIMARY KEY, name VARCHAR) WITH \"template=partitioned\""));
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message