if (i < (arguments.length - 2))
argument.append(",");
}
REXP rdata = null;
try {
rdata = getConnection().eval(function_name + "(" + argument.toString() + ")");
} catch (Exception e) {
ByteArrayOutputStream output = new ByteArrayOutputStream();
e.printStackTrace(new PrintStream(output));
throw new HiveException(new String(output.toByteArray())
+ " -- fail to eval : " + function_name + "("
+ argument.toString() + ")");
}
if (rdata != null) {
try {
if (rdata instanceof REXPInteger) {
return new IntWritable(rdata.asInteger());
} else if (rdata instanceof REXPString) {
return new Text(rdata.asString());
} else if (rdata instanceof REXPDouble) {
return new DoubleWritable(rdata.asDouble());
} else {
throw new HiveException(
"only support integer, string and double");
}
} catch (Exception e) {