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

information_schema should be handled by the engine fully #1559

Closed
findepi opened this issue Sep 19, 2019 · 3 comments · Fixed by #16080
Closed

information_schema should be handled by the engine fully #1559

findepi opened this issue Sep 19, 2019 · 3 comments · Fixed by #16080
Assignees
Labels
bug Something isn't working

Comments

@findepi
Copy link
Member

findepi commented Sep 19, 2019

Using example from #900 we see that eg SQLServer's information_schema leaks out

SELECT (correctly) returns from internal information_schema.columns

presto> SELECT * FROM sqlserver.information_schema.columns;
 table_catalog | table_schema |        table_name        | column_name | ordinal_position | column_default | is_nullable |  data_type   | comment | extra_info
---------------+--------------+--------------------------+-------------+------------------+----------------+-------------+--------------+---------+------------
 sqlserver     | sys          | service_broker_endpoints | name        |                1 | NULL           | YES         | varchar(128) | NULL    | NULL
...

... but DESCRIBE shows columns from SQLServer's information_schema.columns

presto> DESCRIBE sqlserver.information_schema.columns;
          Column          |     Type      | Extra | Comment
--------------------------+---------------+-------+---------
 table_catalog            | varchar(128)  |       |
 table_schema             | varchar(128)  |       |
 table_name               | varchar(128)  |       |
 column_name              | varchar(128)  |       |
 ordinal_position         | integer       |       |
 column_default           | varchar(4000) |       |
 is_nullable              | varchar(3)    |       |
 data_type                | varchar(128)  |       |
 character_maximum_length | integer       |       |
 character_octet_length   | integer       |       |
 numeric_precision        | tinyint       |       |
 numeric_precision_radix  | smallint      |       |
 numeric_scale            | integer       |       |
 datetime_precision       | smallint      |       |
 character_set_catalog    | varchar(128)  |       |
 character_set_schema     | varchar(128)  |       |
 character_set_name       | varchar(128)  |       |
 collation_catalog        | varchar(128)  |       |
 collation_schema         | varchar(128)  |       |
 collation_name           | varchar(128)  |       |
 domain_catalog           | varchar(128)  |       |
 domain_schema            | varchar(128)  |       |
 domain_name              | varchar(128)  |       |
(23 rows)
@findepi findepi added the bug Something isn't working label Sep 19, 2019
@findepi
Copy link
Member Author

findepi commented Sep 19, 2019

Today information_schema needs to be filtered out by each connector individually.

E.g. It is explicitly filtered out here:
https://github.com/prestosql/presto/blob/3536c7da8fe2f4e1bd4954edaeb7cb22029d7316/presto-base-jdbc/src/main/java/io/prestosql/plugin/jdbc/BaseJdbcClient.java#L177
https://github.com/prestosql/presto/blob/85659a03d52fab6c94d771b2d75856d4acc3be4e/presto-mysql/src/main/java/io/prestosql/plugin/mysql/MySqlClient.java#L135
https://github.com/prestosql/presto/blob/83235e86ee57a0ede5b65b509d167de4d2ebd3fe/presto-phoenix/src/main/java/io/prestosql/plugin/phoenix/PhoenixClient.java#L201

Of course, this is error-prone, I witnessed that when working on #1218.
Under that issue, I'm not changing this, just fixing Hive connector,
but I think we should handle everything information_schema-related
outside of the connector, because this schema is handled outside of it.

@findepi findepi changed the title information_schema needs to be correctly filtered out information_schema needs to be filtered out by plugins May 10, 2020
@findepi findepi changed the title information_schema needs to be filtered out by plugins information_schema should be handled by the engine fully May 10, 2020
@findepi
Copy link
Member Author

findepi commented May 15, 2020

@martint or, is our intention to let connector provide additional tables within information_schema schema?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging a pull request may close this issue.

3 participants