英文:
"No enum constant org.apache.orc.CompressionKind.ZSTD" When Insert Data to ORC Compress ZSTD Table
问题
我已经在Hive 3.1.3
中创建了一个表,如下所示:
创建外部表test_tez_orc_zstd
(
Id bigint
)存储为orc
Tblproperties(orc.compress=zstd)
位置 '...'
它已经创建好了,然后我想插入一行:
插入到test_tez_orc_zstd
选择1
然后它抛出了以下错误:
没有org.apache.orc.CompressionKind.ZSTD的枚举常量
Hive配置为使用Tez。
如果我对parquet压缩zstd执行相同的操作,它可以正常工作。
我该如何处理这个问题?
英文:
I have created a table in hive 3.1.3
as below;
Create external table test_tez_orc_zstd
(
Id bigint
)stored as orc
Tblproperties(orc.compress=zstd)
Location '...'
It is created, and then I wanted to insert one row;
Insert into test_tez_orc_zstd
Select 1
Then it throwed following error;
No enum constant org.apache.orc.CompressionKind.ZSTD
Hive is configured to use Tez.
If I do same thing for parquet
compress zstd
it works.
How can I handle this?
答案1
得分: 1
ROOT CAUSE:
Apache Hive版本3.1.3
使用orc
版本1.5.8
,请参见这里。1.6.0
开始支持orc
中的zstd
解压缩;https://issues.apache.org/jira/browse/ORC-363。
您可以在这里查看1.5.8
的枚举常量,以及在这里查看1.6.0
的内容。因此,在这种情况下,我们可以说Hive 3.1.3
不支持Tblproperties(orc.compress=zstd)
。
POSSIBLE SOLUTION:
在Hive中,orc
版本已在发布4.0.0-alpha-1
中升级到1.6.0
以上,详情请参见https://issues.apache.org/jira/browse/HIVE-23553。
这可能具有挑战性,但您可以在发布标签3.1.3
之上回溯相关的提交,然后构建项目并替换Hive库中的相关jar文件。
请注意,不仅仅是orc
依赖项直接存在于Hive的库中,还包括一些大型jar文件,例如hive-exec
。
因此,步骤如下:
- 克隆
hive
并检出到发布标签3.1.3
。 - 回溯将
orc
升级到所需版本的提交。 - 构建项目
mvn clean package -DskipTests
。 - 在您安装Hive的地方,使用
grep
查看Hive库中的orc
,以查看哪些orc
依赖项直接在类路径中,以及哪些大型jar文件包含orc
类。 - 替换您在前一步中识别出的jar文件。
具有挑战性的部分是orc
升级提交可能相当大,并且可能存在冲突。
英文:
ROOT CAUSE:
Apache Hive version 3.1.3
uses orc
version 1.5.8
, please see here. zstd
decompression has been supported in orc
starting from 1.6.0
; https://issues.apache.org/jira/browse/ORC-363.
You can see 1.5.8
enum constants here and 1.6.0
here. So, in this case we can say that Hive 3.1.3
does not support Tblproperties(orc.compress=zstd)
.
POSSIBLE SOLUTION:
In Hive, orc
version has been upgraded to above 1.6.0
in release 4.0.0-alpha-1
here https://issues.apache.org/jira/browse/HIVE-23553.
This might be challenging, but you can backport related commits on top of release tag 3.1.3
, then build the project and replace the related jars in Hive's library.
Please note that not only orc
dependencies are in Hive's library directly, but also they are included into some of the fat jars such as hive-exec
.
So, steps should be as follows;
- Clone
hive
and checkout to release tag3.1.3
. - Backport the commits that upgrade
orc
to the desired version. - Build the project
mvn clean package -DskipTests
. grep
orc
in hive library where you installed hive to see whichorc
dependencies directly in the classpath, and which fat jars haveorc
classes.- Replace the jars that you identified in the previous step.
The challenging part is that orc
upgrade commits can be pretty big, and there might be conflicts.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论