sql - 运行 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'
解决方案
你能试试这个吗?
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'
推荐阅读
- python - 在给定输入中查找python中的最大和最小数字
- html - 根据设备更改文本大小
- c++ - 在 Raspberry PI 上使用 libtorch 构建程序时的链接问题
- java - AndroidStudio 中的 MainActivity 未找到自定义 Java 类
- delphi - 在方法链中用作输出和(非参考)输入的值
- python - Tkinter:将条目设置为只读不起作用
- javascript - 使用自定义原型创建 JS 函数的最佳方法是什么?
- javascript - 配对和挑战
- c++ - 通过命令行在 Visual Studio 中编译单个独立文件
- java - 如何在循环中使用变量存储先前的值?