Wednesday, April 27, 2022

AWS Athena's Information_Schema

The information_schema in most database systems is very useful to get information about tables, views, columns that might be available in that db.

Here are the information schema views available. (WARNING: queries against the information_schema views are very slow)



  catalog_name,  schema_name

FROM information_schema.schemata



  table_catalog,  table_schema,  table_name,  table_type

FROM information_schema.tables



  table_catalog,  table_schema,  table_name,  column_name,  data_type,  is_nullable,

  column_default,  comment

from information_schema.columns

order by

  table_catalog,  table_schema,  table_name,  ordinal_position

Retrieved by looking at the PrestoDB test cases: presto/presto-product-tests/src/main/resources/sql-tests/testcases/system at 2ad67dcf000be86ebc5ff7732bbb9994c8e324a8 · prestodb/presto · GitHub 

No comments: