[英]How to add hive auxiliary jars to Dataproc cluster
當您在 Dataproc 中啟動 hive session 時,您可以添加位於 gcs 存儲桶中的 jars。
add jar gs://my-bucket/serde.jar;
I don't want to have to add all the jars I need each time I start a hive session so I tried adding the jar paths to hive-site.xml in the hive.aux.jars.path property.
<property>
<name>hive.aux.jars.path</name>
<value>gs://my-bucket/serde.jar</value>
</property>
然后我在嘗試啟動 hive session 時遇到此錯誤。
Exception in thread "main" java.lang.IllegalArgumentException: Wrong FS: file://gs, expected: file:///
Is there a way to add custom jars that live in a gcs bucket to the hive classpath or would I have to copy the jars from my bucket and update hive.aux.jars.path each time I create a dataproc cluster?
*編輯
即使添加了以下屬性並重新啟動 hive 我仍然得到同樣的錯誤。
<property>
<name>hive.exim.uri.scheme.whitelist</name>
<value>hdfs,pfile,gs</value>
<final>false</final>
</property>
This is a known Hive bug ( HIVE-18871 ) - hive.aux.jars.path
supports only local paths in Hive 3.1 and lower.
解決方法是使用Dataproc 初始化操作,將 jars 從 GCS 復制到所有 Dataproc 集群節點上的相同本地 FS 路徑,並將此本地路徑指定為hive.aux.jars.path
的值。
HIVE-18871 修復已移植回 Dataproc 1.3+ 映像,因此您可以將hive.aux.jars.path
屬性中的 GCS URI 與具有此修復的新 Dataproc 映像一起使用。
我想您還需要將屬性hive.exim.uri.scheme.whitelist
設置為白名單 gcs uri。
因此,在您的情況下,在創建 Dataproc 集群時,請設置屬性
hive.aux.jars.path = gs://my-bucket/serde.jar
hive.exim.uri.scheme.whitelist = hdfs,pfile,gs
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.