You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何使用Trino创建基于STRUCT/ROW列内部字段分区的Iceberg表?

问题描述

尝试创建基于ROW类型内部字段分区的Iceberg表,执行语句:

create table person(address ROW(city VARCHAR)) with (partitioning=ARRAY['address.city']);

执行后报错:

Query failed: Unable to parse partitioning value: Invalid partition field declaration: address.city
解决方案

针对Iceberg嵌套ROW/STRUCT字段分区的语法问题,可尝试以下几种修复方式:

  • 使用方括号语法访问嵌套字段,注意引号转义:

    create table person(address ROW(city VARCHAR)) with (partitioning=ARRAY['address[\'city\']']);
    
  • 明确使用分区转换语法指定嵌套字段路径,这种方式兼容性更强:

    create table person(address ROW(city VARCHAR)) with (partitioning=ARRAY['identity(address.city)']);
    
  • 检查并升级Iceberg及对应查询引擎版本,旧版本可能存在嵌套字段分区的解析缺陷。

内容的提问来源于stack exchange,提问作者ritratt

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.09 12:57:08