Skip to content

Conversation

bpintea
Copy link
Collaborator

@bpintea bpintea commented Mar 27, 2020

This fixes the mappings of ES/SQL's varchar types to the ODBC SQL data
types:

  • the KEYWORD, CONSTANT_KEYWORD and TEXT types are now SQL_WVARCHAR types.
    Most applications will request the driver translation to a wide string, but
    some inspect and differentiate between SQL_WVARCHAR and SQL_VARCHAR source
    types and will request translation to a SQL_C_WCHAR and SQL_C_CHAR type
    respectively. In case the target C type is SQL_C_WCHAR, the driver needs to do
    a recoding to UTF16.
  • IP and the other string types (like GEO ones) remain to the previous
    SQL_VARCHAR types.

The handling of double types has also been fixed to reflect the
correction in Elasticsearch/SQL that now maps DOUBLE and SCALED_FLOAT to
the same type (SQL_DOUBLE).

bpintea added 3 commits March 24, 2020 20:11
This commit fixes the mappings of the varchar types to the ODBC data
types:
- the KEYWORD, CONSTANT_KEYWORD and TEXT types are now SQL_WVARCHAR,
which allows certain applications to correctly read the UTF8 content.
- IP and the other string types (like GEO ones) remain to the previous
SQL_VARCHAR types.

The handling of double types has also been fixed to reflect the
correction in Elasticsearch/SQL that now maps DOUBLE and SCALED_FLOAT to
the same type (SQL_DOUBLE).
add tests querying for SQL source type.
update the definition of the ES/SQL types used in unit tests.
Copy link
Contributor

@droberts195 droberts195 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bpintea bpintea merged commit 45a82b1 into elastic:master Mar 27, 2020
@bpintea bpintea deleted the fix/sql_c_types branch March 27, 2020 13:50
bpintea added a commit that referenced this pull request Mar 30, 2020
* Fix ES varchar types mappings to ODBC types

This commit fixes the mappings of the varchar types to the ODBC data
types:
- the KEYWORD, CONSTANT_KEYWORD and TEXT types are now SQL_WVARCHAR,
which allows certain applications to correctly read the UTF8 content.
- IP and the other string types (like GEO ones) remain to the previous
SQL_VARCHAR types.

The handling of double types has also been fixed to reflect the
correction in Elasticsearch/SQL that now maps DOUBLE and SCALED_FLOAT to
the same type (SQL_DOUBLE).

* Supplement tests for the varchar type change

add tests querying for SQL source type.

* update types defs for unit test

update the definition of the ES/SQL types used in unit tests.

(cherry picked from commit 45a82b1)
bpintea added a commit that referenced this pull request Mar 30, 2020
* Fix ES varchar types mappings to ODBC types

This commit fixes the mappings of the varchar types to the ODBC data
types:
- the KEYWORD, CONSTANT_KEYWORD and TEXT types are now SQL_WVARCHAR,
which allows certain applications to correctly read the UTF8 content.
- IP and the other string types (like GEO ones) remain to the previous
SQL_VARCHAR types.

The handling of double types has also been fixed to reflect the
correction in Elasticsearch/SQL that now maps DOUBLE and SCALED_FLOAT to
the same type (SQL_DOUBLE).

* Supplement tests for the varchar type change

add tests querying for SQL source type.

* update types defs for unit test

update the definition of the ES/SQL types used in unit tests.

(cherry picked from commit 45a82b1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants