com.bazaarvoice.emodb.hive.udf.EmoLong Maven / Gradle / Ivy
package com.bazaarvoice.emodb.hive.udf;
import com.fasterxml.jackson.core.JsonParser;
import org.apache.hadoop.hive.ql.exec.Description;
import org.apache.hadoop.hive.ql.udf.UDFType;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import java.io.IOException;
@UDFType (deterministic = true)
@Description (name = "emo_long", value = "Gets the long value from an EmoDB entry JSON")
public class EmoLong extends AbstractEmoFieldUDF {
public LongWritable evaluate(final Text json, final Text field) {
return evaluateAndNarrow(json, field);
}
@Override
protected LongWritable narrow(JsonParser parser)
throws IOException {
return narrowToLong(parser);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy