【问题标题】:aws athena : how to make filter is required for columnaws athena:列需要如何制作过滤器
【发布时间】:2020-08-12 12:35:30
【问题描述】:
当我对表“information_schema .__ internal_partitions__”进行查询时,我收到以下错误消息:GENERIC_INTERNAL_ERROR: filter is required for column: information_schema .__ internal_partitions __。表模式
是否可以在我将创建的表中的列上添加相同的条件
tnx
【问题讨论】:
标签:
amazon-web-services
amazon-athena
information-schema
【解决方案1】:
根据 Athena 背后的后端数据库PrestoDB GitHub,此错误仅在您尝试查询 table_schema 或 table_name 时显示。
【解决方案2】:
由于错误表明您无法查询整个表。您需要在 table_schema 列上应用过滤器,如下例所示:
SELECT *
FROM information_schema.__internal_partitions__
WHERE table_schema = 'default'
AND table_name = 'cloudtrail_logs_test2'
ORDER BY partition_number
有关这方面的更多示例,请参阅 this 文档。
【解决方案3】:
我的问题是:我可以在我要创建的另一个表中的列中添加一个约束吗?
例如,如果我有一个包含 C1、C2 和 C3 列的表 T1。
除非 C3 有条件,否则我不允许任何“选择”。