我试图通过运行SQL查询来从AWS athena获取元数据:
SELECT table_catalog, table_schema, table_name FROM information_schema.tables
WHERE table_schema = 'information_schema'
当我收到错误时:
找不到数据库information_schema。请检查您的查询。
查询运行正常,没有WHERE子句或其他条件。我错过了什么吗?
答案 0 :(得分:-1)
尝试提供完整的列路径,例如information_schema.tables.table_schema
查询其他架构时,最好提供列名的完整路径。
因此您的查询将如下所示:
SELECT table_catalog, table_schema, table_name FROM information_schema.tables
WHERE information_schema.tables.table_schema = 'information_schema'