spark报错:ROW FORMAT SERDE is incompatible with format ‘orc‘

阅读 110

2022-02-22

错误样例:

CREATE TABLE wangriyu_bugtt1(
task_no int,
exec_ip int)
ROW FORMAT SERDE 'org.apache.hadoop.hive.ql.io.orc.OrcSerde'
STORED AS ORC

报错:

Error in query:
Operation not allowed: ROW FORMAT SERDE is incompatible with format 'orc', which also specifies a serde(line 1, pos 0)

原因:

spark建orc表会自动使用ROW FORMAT SERDE 'org.apache.hadoop.hive.ql.io.orc.OrcSerde',不需要显示指定。

解决方案:

CREATE TABLE wangriyu_bugtt1(
task_no int,
exec_ip int)
ROW FORMAT SERDE 'org.apache.hadoop.hive.ql.io.orc.OrcSerde'
STORED AS ORC

精彩评论(0)

0 0 举报