我正在尝试使用Hive Connector在Trino上创建一个表,并使用Json作为数据源。
create table if not exists test.json_table
(
"timestamp" STRING,
"header" array[STRUCT<id:STRING, type:STRING, name:STRING, timestamp:STRING, name2:STRING, version:STRING>],
"data" array[STRUCT<subtype:STRING, acc_number:STRING>]
)
WITH (
external_location = 's3a://path/json-file',
format = 'JSON'
);这在Trino中不起作用。因为语法似乎与Presto / Athena不同。
有没有人能给点建议!谢谢
发布于 2021-05-05 10:37:44
设法弄清楚了这一点。
如果你有其他方法做SerDe,那就分享吧
CREATE TABLE IF NOT EXISTS test.data(
timestamp varchar,
header ROW(id varchar, type VARCHAR, client varchar)
)
WITH (
format='json',
external_location='s3a://path/json-file'
);然后使用header.id查询您的数据,例如header.type。
https://stackoverflow.com/questions/67371800
复制相似问题