【问题标题】:"Iceberg query cannot be parsed" when trying to create Iceberg table with MAP column data type in Athena?尝试在 Athena 中创建具有 MAP 列数据类型的 Iceberg 表时,“无法解析 Iceberg 查询”?
【发布时间】:2022-06-12 23:36:28
【问题描述】:

根据Athena Iceberg documentation,支持map类型。

为什么这些语句都不起作用?

CREATE TABLE iceberg_test1 (id string, themap map)
  LOCATION 's3://mybucket/test/iceberg1'
  TBLPROPERTIES ( 'table_type' = 'ICEBERG' );

错误:

无法解析冰山查询

第二次尝试:

CREATE TABLE iceberg_test1 (id string, themap map<varchar,varchar>)
  LOCATION 's3://mybucket/test/iceberg1'
  TBLPROPERTIES ( 'table_type' = 'ICEBERG' );

同样的错误:

无法解析冰山查询

【问题讨论】:

    标签: amazon-athena athena iceberg apache-iceberg


    【解决方案1】:

    map(未指定键/值类型)和varchar 都不是有效的 Iceberg 类型。请参阅 valid types 的 Iceberg 文档。

    CREATE TABLE iceberg_test1 (id string, themap map<string, string>)
      LOCATION 's3://mybucket/test/iceberg1'
      TBLPROPERTIES ( 'table_type' = 'ICEBERG' );
    

    只要您有权访问 S3 位置,就可以使用。

    【讨论】:

      猜你喜欢
      • 2022-10-25
      • 2022-11-09
      • 2022-12-29
      • 2022-08-10
      • 2021-04-06
      • 2019-01-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多