Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQL: SYS TABLES: enumerate tables of requested types #40348

Closed
bpintea opened this issue Mar 22, 2019 · 1 comment

Comments

Projects
None yet
4 participants
@bpintea
Copy link
Contributor

commented Mar 22, 2019

For the following request

{"query": "SYS TABLES TYPE 'TABLE','VIEW'", "mode": "ODBC", "client_id": "odbc32"}

the server answers currently with:

{"columns":[{"name":"TABLE_CAT","type":"keyword","display_size":0},{"name":"TABLE_SCHEM","type":"keyword","display_size":0},{"name":"TABLE_NAME","type":"keyword","display_size":0},{"name":"TABLE_TYPE","type":"keyword","display_size":0},{"name":"REMARKS","type":"keyword","display_size":0},{"name":"TYPE_CAT","type":"keyword","display_size":0},{"name":"TYPE_SCHEM","type":"keyword","display_size":0},{"name":"TYPE_NAME","type":"keyword","display_size":0},{"name":"SELF_REFERENCING_COL_NAME","type":"keyword","display_size":0},{"name":"REF_GENERATION","type":"keyword","display_size":0}],"rows":[[null,null,null,"BASE TABLE",null,null,null,null,null,null],[null,null,null,"VIEW",null,null,null,null,null,null]]}

which is in fact an enumeration of the requested types, lacking any actual table information.
Expected would be to have the server list all available tables of the requested type, as this query currently yields:

SYS TABLES CATALOG LIKE '%' LIKE '%' TYPE 'TABLE','VIEW'

(with schema support currently missing).

This corresponds to an ODBC client specifying all NULL for all the filtering parameters except "TableType" in the SQLTables API call.

@bpintea bpintea added the :Search/SQL label Mar 22, 2019

@elasticmachine

This comment has been minimized.

Copy link

commented Mar 22, 2019

@costin costin self-assigned this Mar 22, 2019

costin added a commit to costin/elasticsearch that referenced this issue Mar 27, 2019

SQL: Polish behavior of SYS TABLES command
SYS TABLES meta command has been improved to better adhere to the ODBC
spec in particular with regards to the handling of enumerations (and
the differences between '%', null and ''(empty string))

Fix elastic#40348

costin added a commit to costin/elasticsearch that referenced this issue Mar 27, 2019

SQL: Polish behavior of SYS TABLES command
SYS TABLES meta command has been improved to better adhere to the ODBC
spec in particular with regards to the handling of enumerations (and
the differences between '%', null and ''(empty string))

Fix elastic#40348

costin added a commit that referenced this issue Mar 28, 2019

SQL: Polish behavior of SYS TABLES command (#40535)
SYS TABLES meta command has been improved to better adhere to the ODBC
spec in particular with regards to the handling of enumerations (and
the differences between '%', null and ''(empty string))

Fix #40348

costin added a commit that referenced this issue Mar 28, 2019

SQL: Polish behavior of SYS TABLES command (#40535)
SYS TABLES meta command has been improved to better adhere to the ODBC
spec in particular with regards to the handling of enumerations (and
the differences between '%', null and ''(empty string))

Fix #40348

(cherry picked from commit e307061)

@jakelandis jakelandis added v7.0.0-rc2 and removed v7.0.0 labels Apr 3, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.