HIVE-10710 Delete GenericUDF.getConstantLongValue (Alexander Pivovarov, reviewed by Ashutosh Chauhan)
Project: http://git-wip-us.apache.org/repos/asf/hive/repo Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/55b28a0a Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/55b28a0a Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/55b28a0a Branch: refs/heads/spark Commit: 55b28a0a93240270956688ec4bb5a98337bceb00 Parents: d362985 Author: Alexander Pivovarov <apivova...@gmail.com> Authored: Thu May 14 10:12:06 2015 -0700 Committer: Alexander Pivovarov <apivova...@gmail.com> Committed: Mon Jun 1 14:35:48 2015 -0700 ---------------------------------------------------------------------- .../hadoop/hive/ql/udf/generic/GenericUDF.java | 23 -------------------- 1 file changed, 23 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hive/blob/55b28a0a/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDF.java ---------------------------------------------------------------------- diff --git a/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDF.java b/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDF.java index b043bdc..e8df5d3 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDF.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDF.java @@ -538,29 +538,6 @@ public abstract class GenericUDF implements Closeable { return v; } - protected Long getConstantLongValue(ObjectInspector[] arguments, int i) - throws UDFArgumentTypeException { - Object constValue = ((ConstantObjectInspector) arguments[i]).getWritableConstantValue(); - if (constValue == null) { - return null; - } - long v; - if (constValue instanceof IntWritable) { - v = ((LongWritable) constValue).get(); - } else if (constValue instanceof IntWritable) { - v = ((IntWritable) constValue).get(); - } else if (constValue instanceof ShortWritable) { - v = ((ShortWritable) constValue).get(); - } else if (constValue instanceof ByteWritable) { - v = ((ByteWritable) constValue).get(); - } else { - throw new UDFArgumentTypeException(i, getFuncName() - + " only takes LONG/INT/SHORT/BYTE types as " + getArgOrder(i) + " argument, got " - + constValue.getClass()); - } - return v; - } - protected String getArgOrder(int i) { i++; switch (i % 100) {