Hive 使用presto从配置单元外部表查询:UTF-8起始字节无效

Hive 使用presto从配置单元外部表查询:UTF-8起始字节无效,hive,hdfs,presto,Hive,Hdfs,Presto,我刚刚安装了presto,当我使用presto cli查询配置单元数据时,出现以下错误: ~$ presto --catalog hive --schema default presto:default> select count(*) from test3; Query 20171213_035723_00007_3ktan, FAILED, 1 node Splits: 131 total, 14 done (10.69%) 0:18 [1.04M rows, 448MB] [59.

我刚刚安装了presto,当我使用presto cli查询配置单元数据时,出现以下错误:

~$ presto --catalog hive --schema default
presto:default> select count(*) from test3;

Query 20171213_035723_00007_3ktan, FAILED, 1 node
Splits: 131 total, 14 done (10.69%)
0:18 [1.04M rows, 448MB] [59.5K rows/s, 25.5MB/s]

Query 20171213_035723_00007_3ktan failed: com.facebook.presto.hive.$internal.org.codehaus.jackson.JsonParseException: Invalid UTF-8 start byte 0xa5
 at [Source: java.io.ByteArrayInputStream@6eb5bdfd; line: 1, column: 376]
只有在使用聚合函数(如count、sum等)时才会发生错误。 但是,当我在Hive CLI上使用相同的查询时,它会起作用(但由于它将查询转换为map reduce作业,因此需要花费大量时间)

关键是相同的查询在Hive上有效,但在Presto上无效,我不知道为什么。我怀疑这是因为Hive和Presto上使用的2 json库不同,但我不太确定。 我使用以下查询在配置单元上创建了外部表:

hive> create external table test2 (app string, contactRefId string, createdAt struct <`date`: string, timezone: string, timezone_type: bigint>, eventName string, eventTime bigint, shopId bigint) ROW FORMAT SERDE 'org.apache.hive.hcatalog.data.JsonSerDe' STORED AS TEXTFILE LOCATION '/data/data-new/2017/11/29/';
hive>create external table test2(app string、contactRefId string、createdAt struct、eventName string、eventTime bigint、shopId bigint)行格式SERDE'org.apache.hive.hcatalog.data.JsonSerDe'存储为TEXTFILE LOCATION'/data/data new/2017/11/29/';

有人能帮我吗?

将此贴在这里以供参考:

发件人:

我使用这个serde成功地解决了这个问题:(添加到presto at/usr/lib/presto/plugin/hive-hadoop2/和hive cluster at/usr/lib/hive-hcatalog/share/hcatalog/)


请使用
--debug
标志运行CLI,并将问题发布到presto用户列表()。这种问题不适合这样做——一旦你的问题得到正确的定义,它也会得到解决。我试着把我的问题贴在这里。我看到你解决了你的问题。考虑在这里报告你的解决方案,这样就不会有悬而未决的问题了。
hive> create external table test2 (app string, contactRefId string, createdAt struct <`date`: string, timezone: string, timezone_type: bigint>, eventName string, eventTime bigint, shopId bigint) ROW FORMAT SERDE 'org.apache.hive.hcatalog.data.JsonSerDe' STORED AS TEXTFILE LOCATION '/data/data-new/2017/11/29/';