首页 > 解决方案 > 在按需 hdinsight 集群的配置单元脚本中使用 JsonSerDe

问题描述

我编写了一个在现有 HDInsight 群集中运行良好的配置单元脚本。但是,当我通过按需集群中的 Azure 数据工厂实例化脚本时,出现以下错误:

Caused by: java.lang.ClassNotFoundException: Class org.apache.hive.hcatalog.data.JsonSerDe not found
at org.apache.hadoop.conf.Configuration.getClassByName(Configuration.java:2214)
at org.apache.hadoop.hive.ql.plan.PartitionDesc.getDeserializer(PartitionDesc.java:143)
at org.apache.hadoop.hive.ql.exec.MapOperator.getConvertedOI(MapOperator.java:316)
... 19 more

我使用 JsonSerDe 将数据从 JSON 文件加载到配置单元表中。在我现有的集群中,该类在没有任何额外配置的情况下存在。是否有必要为按需集群明确指定 JsonSerDe JAR 文件,如果是这样,这怎么可能?

标签: azurehiveuser-defined-functionsazure-hdinsight

解决方案


当您缺少 Jar 文件时,您将收到此错误消息。

您可以在 ADF Hive 活动中添加 Jar 文件,如图所示。

转到活动 => 文件路径 => 浏览本地并添加 Jar 文件。

在此处输入图像描述


推荐阅读