使用gcloud dataproc创建配置单元表不适用于unicode分隔符

nqwrtyyt  于 2021-07-15  发布在  Hadoop
关注(0)|答案(1)|浏览(242)

我需要在unicode分隔文件(unicode字符-.“\ufffd”,替换字符)上创建配置单元表
为此,我们将向集群提交配置单元作业。尝试使用行格式分隔的惰性简单serde-
gcloud dataproc jobs submit hive--cluster--region--execute“create external table hiveuni\u test\u 01(codes string,telephone\u num string,finding\u name string,given\u name string,alt\u finding\u name string,house\u num string,street\u name string,locality string,state string,reserved string,zip\u code string,directive\u text string,special\u listing\u text stri,id字符串、纬度字符串、经度字符串、rboc_sent_date字符串)行格式分隔字段,以“\ufffd”行结尾,以“\n”行结尾,存储为textfile location“gs://hive idaas dev warehouse/datasets/unicode_file”;”
但这并不能正确创建表,整行只放在第一列。
我们使用云sqlmysql服务器作为配置单元元存储,检查mysql是否也有utf8编码。
与Multiserde一起试用-
gcloud dataproc jobs submit hive--cluster dev-sm-35cb3516-ed82-4ec2-bf0d-89bd7e0e60f0--region us-central1--jars gs://hive idaas dev warehouse/hive jar/hive-contrib-0.14.0.jar--execute“create external table hiveuni test_05(codes string,telephone_num string,finding_name string,given_name string,alt_finding_name string,house_num string,街道名称字符串、位置字符串、状态字符串、保留字符串、邮政编码字符串、指令文本字符串、特殊列表文本字符串、id字符串、纬度字符串、经度字符串,rboc_sent_date string)行格式serde'org.apache.hadoop.hive.serde2.multidivideserde',serdeproperties('field.delim'='\ufffd')存储为inputformat'org.apache.hadoop.mapred.textinputformat'outputformat'org.apache.hadoop.hive.ql.io.hiveignorekeytextoutputformat'location'gs://hive idaas dev warehouse/datasets/unicode_file';“
这是个例外- java.lang.ClassNotFoundException: Class org.apache.hadoop.hive.serde2.MultiDelimitSerDe not found 我已经在集群启动期间放置了一个初始化脚本,它将 hive-contrib-0.14.0.jar 包含类 org.apache.hadoop.hive.serde2.MultiDelimitSerDe/usr/lib/hadoop/lib/ . 我看到jar通过对集群执行ssh被放置在文件夹中。
有没有一种方法可以在创建表时通过配置单元客户端读取unicode字符,或者为什么即使将jar放在hadoop lib目录中,仍然会出现错误classnotfound?

3mpgtkmj

3mpgtkmj1#

hive-contrib-0.14.0 没有 org.apache.hadoop.hive.serde2.MultiDelimitSerDe . 相反,完整的限定类名是 org.apache.hadoop.hive.contrib.serde2.MultiDelimitSerDe . 注意额外的 contrib 在那里。
因此,请更改查询以使用正确的完全限定类名,并查看它是否解决了问题。您可能不必显式地添加hivecontribjar。它应该已经在 /usr/lib/hive/lib .
hive-20020和hive-20619是在hive4.0上完成的,由于您使用的是dataproc,所以它不应该应用,因为dataproc还没有hive4.0。

相关问题