我正在尝试使用直线在Hive上创建一个表。数据作为Parquet文件存储在hdfs中,它们具有以下模式:
{
"object_type":"test",
"heartbeat":1496755564224,
"events":[
{
"timestamp":1496755582985,
"hostname":"hostname1",
"instance":"instance1",
"metrics_array":[
{
"metric_name":"metric1_1",
"metric_value":"value1_1"
}
]
},
{
"timestamp":1496756626551,
"hostname":"hostname2",
"instance":"instance1",
"metrics_array":[
{
"metric_name":"metric2_1",
"metric_value":"value2_1"
}
]
}
]
}
用于创建表的hql脚本如下所示:
set hive.support.sql11.reserved.keywords=false;
CREATE DATABASE IF NOT EXISTS datalake;
DROP TABLE IF EXISTS datalake.test;
CREATE EXTERNAL TABLE IF NOT EXISTS datalake.test
(
object_type STRING,
heartbeat BIGINT,
events STRUCT <
metrics_array: STRUCT <
metric_name: STRING,
metric_value: STRING
>,
timestamp: BIGINT,
hostname: STRING,
instance: STRING
>
)
STORED AS PARQUET
LOCATION '/tmp/test/';
下面是我在执行select*from datalake.test时遇到的错误:
错误:java.io.ioexception:org.apache.parquet.io.parquetdecodingexception:无法读取文件中块-1中0处的值hdfs://tmp/test/part-r-00000-7e58b193-a08f-44b1-87fa-bb12b4053bdf.gz.parquet (状态=,代码=0)
有什么想法吗?
谢谢!
暂无答案!
目前还没有任何答案,快来回答吧!