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

Vladimir Ozerov edited comment on IGNITE-10585 at 12/24/18 8:14 AM:
--------------------------------------------------------------------

Hi [~ldz],
The patch may fix {{REAL}} type metadata, but brakes {{FLOAT}}, so we cannot 
accept it. Note that for us {{REAL}} and {{FLOAT}} are the same data types, as 
both are mapped to {{java.lang.Float}}. We do not store original SQL data type 
anywhere. Instead, only relevant Java type is stored in cache configuration and 
table descriptor. For this reason we cannot distinguish between {{REAL}} and 
{{FLOAT}} data types in runtime.

Correct fix should not break existing behavior of {{FLOAT}}. In order to 
distinguish between these two types in runtime we would have to attach SQL type 
information to cache configuration when {{CREATE TABLE}} is called, this is 
huge effort. 


was (Author: vozerov):
Hi [~ldz],
The patch may fix {{REAL}} type metadata, but brakes {{FLOAT}}, so we cannot 
accept it. Note that for us {{REAL}} and {{FLOAT}} are the same data types, as 
both are mapped to {{java.lang.Float}}. We do not store original SQL data type 
anywhere. Instead, only relevant Java type is stored in cache configuration and 
table descriptor. For this reason we cannot distinguish between {{REAL}} and 
{{FLOAT}} data types in runtime.

Correct fix should not break existing behavior of {{FLOAT}}. IN order to 
distinguish between these two types in runtime we would have to attach SQL type 
information to cache configuration when {{CREATE TABLE}} is called, this is 
huge effort. 

> JDBC driver returns FLOAT in column metadata for REAL SQL type
> --------------------------------------------------------------
>
>                 Key: IGNITE-10585
>                 URL: https://issues.apache.org/jira/browse/IGNITE-10585
>             Project: Ignite
>          Issue Type: Bug
>          Components: jdbc
>    Affects Versions: 2.7
>            Reporter: Ray
>            Assignee: Ray
>            Priority: Major
>             Fix For: 2.8
>
>
> When I create a table usingĀ 
> create table c(a varchar, b real, primary key(a));
> The meta information for column b is wrong when I use !desc c to check.
> 0: jdbc:ignite:thin://127.0.0.1/> !desc c
>  TABLE_CAT
>  TABLE_SCHEM PUBLIC
>  TABLE_NAME C
>  COLUMN_NAME A
>  DATA_TYPE 12
>  TYPE_NAME VARCHAR
>  COLUMN_SIZE null
>  BUFFER_LENGTH null
>  DECIMAL_DIGITS null
>  NUM_PREC_RADIX 10
>  NULLABLE 1
>  REMARKS
>  COLUMN_DEF
>  SQL_DATA_TYPE 12
>  SQL_DATETIME_SUB null
>  CHAR_OCTET_LENGTH 2147483647
>  ORDINAL_POSITION 1
>  IS_NULLABLE YES
>  SCOPE_CATLOG
>  SCOPE_SCHEMA
>  SCOPE_TABLE
>  SOURCE_DATA_TYPE null
>  IS_AUTOINCREMENT NO
>  IS_GENERATEDCOLUMN NO
> TABLE_CAT
>  TABLE_SCHEM PUBLIC
>  TABLE_NAME C
>  COLUMN_NAME B
>  DATA_TYPE 7
>  {color:#d04437}TYPE_NAMEĀ FLOAT{color}
>  COLUMN_SIZE null
>  BUFFER_LENGTH null
>  DECIMAL_DIGITS null
>  NUM_PREC_RADIX 10
>  NULLABLE 1
>  REMARKS
>  COLUMN_DEF
>  SQL_DATA_TYPE 8
>  SQL_DATETIME_SUB null
>  CHAR_OCTET_LENGTH 2147483647
>  ORDINAL_POSITION 2
>  IS_NULLABLE YES
>  SCOPE_CATLOG
>  SCOPE_SCHEMA
>  SCOPE_TABLE
>  SOURCE_DATA_TYPE null
>  IS_AUTOINCREMENT NO
>  IS_GENERATEDCOLUMN NO



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to