Kryo class not found exception in hive 0.13 - Hadoop

I have GenericUDF (see code below) that works fine on Hadoop-1 and Hive-0.12. But when testing the same GenericUDF using Hive-0.13 + Hadoop-2, I get the following error.

Vertex error, vertexName = Map 12, vertexId = vertex_1409698731658_42202_1_00, diagnostics = [Vertex Input: ccv initializer failed., Org.apache.hive.com.esotericsoftware.kry o.KryoException: could not find class: com.xxx.xxx.Id1

Here is the code for my UDF.

package com.xxx.xxx; import org.apache.hadoop.hive.*; public class Id1 extends GenericUDF { private MapredContext context; private long sequenceNum = 0; private static final int padLength = 10; StringBuilder sb = null; public ObjectInspector initialize(ObjectInspector[] arguments) throws UDFArgumentException { sequenceNum = 0; sb = new StringBuilder(); return PrimitiveObjectInspectorFactory.javaStringObjectInspector; } public Object evaluate(DeferredObject[] arguments) throws HiveException { int sbLength = sb.toString().length(); if (sbLength > 0) sb.replace(0, sbLength, ""); String taskId = null; if (context.getJobConf() != null) taskId = context.getJobConf().get("mapred.taskid"); sequenceNum++; if (taskId != null) { sb.append(taskId.replace("attempt_", "")); } int i = 0; String seqStr = String.valueOf(sequenceNum); sb.append(seqStr); return sb.toString(); } public String getDisplayString(String[] children) { return "id1()"; } @Override public void configure(MapredContext context) { this.context = context; } } 

I am sure that this has something to do with Hive-0.13, but cannot see the message associated with this error.

+6
source share

Source: https://habr.com/ru/post/976592/


All Articles