当您在 Dataproc 中启动 hive 会话时,您可以添加位于 gcs 存储桶中的 jar。
add jar gs://my-bucket/serde.jar;
我不想在每次启动 hive 会话时都添加我需要的所有 jar,因此我尝试将 jar 路径添加到 hive.aux.jars.path 属性中的 hive-site.xml。>
<property>
<name>hive.aux.jars.path</name>
<value>gs://my-bucket/serde.jar</value>
</property>
然后我在尝试启动 hive 会话时遇到此错误。
Exception in thread "main" java.lang.IllegalArgumentException: Wrong FS: file://gs, expected: file:///
有没有办法将 gcs 存储桶中的自定义 jar 添加到 hive 类路径,或者我是否必须从存储桶中复制 jar 并在每次创建 dataproc 集群时更新 hive.aux.jars.path?< /p>
*编辑
即使在添加以下属性并重新启动配置单元后,我仍然遇到相同的错误。
<property>
<name>hive.exim.uri.scheme.whitelist</name>
<value>hdfs,pfile,gs</value>
<final>false</final>
</property>
答案 0 :(得分:1)
这是一个已知的 Hive 错误 (HIVE-18871) - hive.aux.jars.path
仅支持 Hive 3.1 及更低版本中的本地路径。
解决方法是使用 Dataproc initialization action 将 jars 从 GCS 复制到所有 Dataproc 集群节点上的相同本地 FS 路径,并将此本地路径指定为 hive.aux.jars.path
属性的值。
HIVE-18871 修复了 back ported to Dataproc 1.3+ 个图像,因此您可以将 hive.aux.jars.path
属性中的 GCS URI 与具有此修复的新 Dataproc 图像一起使用。
答案 1 :(得分:0)
我猜您还需要将属性 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