首页 > 解决方案 > 运行 information_schema 查询时出现 AWS Athena 错误

问题描述

在 Athena 中运行 information_schema 查询时,出现以下错误:

Your query has the following error(s): 

GENERIC_INTERNAL_ERROR: java.lang.RuntimeException: java.lang.InterruptedException: sleep interrupted

This query ran against the "default" database, unless qualified by the query. Please post the error message on our forum or contact customer support with Query Id: 277863e6-3f46-49a0-894b-e712cd49f9c0.

错误更改默认为我选择的任何数据库。

脚本是:

SELECT t.table_schema, t.table_name, c.column_name, c.is_nullable, c.data_type
FROM   information_schema.schemata s
INNER JOIN information_schema.tables t on s.schema_name = t.table_schema
INNER JOIN information_schema.columns c on c.table_name = t.table_name AND c.table_schema = t.table_schema
WHERE c.table_catalog = 'awsdatacatalog'

标签: sqlamazon-web-servicesamazon-athena

解决方案


你能试试这个吗?

SELECT t.table_schema, t.table_name, c.column_name, c.is_nullable, 
c.data_type
FROM   "information_schema"."schemata" s
INNER JOIN "information_schema"."tables" t on s.schema_name = t.table_schema
INNER JOIN "information_schema"."columns" c on c.table_name = t.table_name AND c.table_schema = t.table_schema
WHERE c.table_catalog = 'awsdatacatalog'

推荐阅读