【发布时间】:2021-09-03 03:20:46
【问题描述】:
我正在尝试将 AWS S3 中 parquet 文件中的数据加载到雪花表中。但得到以下错误。你能帮忙吗?
SQL 编译错误:PARQUET 文件格式只能生成一列类型变量或对象或数组。如果要加载多列,请使用 CSV 文件格式。
Parquet 文件架构
|-- uuid: string (nullable = true)
|-- event_timestamp: timestamp (nullable = true)
|-- params: array (nullable = true)
| |-- element: struct (containsNull = true)
| | |-- id: string (nullable = true)
| | |-- name: string (nullable = true)
| | |-- type: string (nullable = true)
| | |-- value: string (nullable = true)
这是示例数据。 uuid,事件时间戳,参数 3f230ea5-dd52-4cf9-bdde-b79201eb1001,2020-05-10 17:06:21.524,[{id=501, type=custom, name=filtering, value=true}, {id=502, type=custom, name =select, value=false}]
雪花桌
create or replace table temp_log (
uuid string,
event_timestamp timestamp,
params array);
我正在使用下面的复制命令来加载数据
copy into temp_log
from '<<s3 path>>'
pattern = '*.parquet'
storage_integration = <<integration object>
file_format = (
type = parquet
compression = snappy
)
;
【问题讨论】:
标签: snowflake-cloud-data-platform parquet