15 package com.cloudera.impala.hive.executor;
17 import org.apache.hadoop.hive.ql.exec.UDF;
18 import org.apache.hadoop.hive.serde2.io.ByteWritable;
19 import org.apache.hadoop.hive.serde2.io.DoubleWritable;
20 import org.apache.hadoop.hive.serde2.io.ShortWritable;
21 import org.apache.hadoop.hive.serde2.io.TimestampWritable;
22 import org.apache.hadoop.io.BooleanWritable;
23 import org.apache.hadoop.io.BytesWritable;
24 import org.apache.hadoop.io.FloatWritable;
25 import org.apache.hadoop.io.IntWritable;
26 import org.apache.hadoop.io.LongWritable;
27 import org.apache.hadoop.io.Text;
37 public BooleanWritable
evaluate(BooleanWritable a) {
38 if (a == null)
return null;
39 return new BooleanWritable(a.get());
42 if (a == null)
return null;
43 return new ByteWritable(a.get());
45 public ShortWritable
evaluate(ShortWritable a) {
46 if (a == null)
return null;
47 return new ShortWritable(a.get());
50 if (a == null)
return null;
51 return new IntWritable(a.get());
54 if (a == null)
return null;
55 return new LongWritable(a.get());
57 public FloatWritable
evaluate(FloatWritable a) {
58 if (a == null)
return null;
59 return new FloatWritable(a.get());
61 public DoubleWritable
evaluate(DoubleWritable a) {
62 if (a == null)
return null;
63 return new DoubleWritable(a.get());
65 public BytesWritable
evaluate(BytesWritable a) {
66 if (a == null)
return null;
67 return new BytesWritable(a.getBytes());
70 if (a == null)
return null;
71 return new Text(a.getBytes());
73 public TimestampWritable
evaluate(TimestampWritable a) {
74 if (a == null)
return a;
75 return new TimestampWritable(a);
78 if (a == null)
return a;
82 public DoubleWritable
evaluate(DoubleWritable arg1, DoubleWritable arg2) {
83 if (arg1 == null || arg2 == null)
return null;
84 return new DoubleWritable(arg1.get() + arg2.get());
88 if (a == null || b == null)
return null;
String evaluate(String a, String b)
DoubleWritable evaluate(DoubleWritable a)
BooleanWritable evaluate(BooleanWritable a)
String evaluate(String a)
ByteWritable evaluate(ByteWritable a)
FloatWritable evaluate(FloatWritable a)
LongWritable evaluate(LongWritable a)
IntWritable evaluate(IntWritable a)
BytesWritable evaluate(BytesWritable a)
TimestampWritable evaluate(TimestampWritable a)
DoubleWritable evaluate(DoubleWritable arg1, DoubleWritable arg2)
ShortWritable evaluate(ShortWritable a)