private static String callFunction(String inputStr, String localeIsoCode, SortOrder sortOrder) throws Exception {
LiteralExpression inputStrLiteral, localeIsoCodeLiteral;
inputStrLiteral = LiteralExpression.newConstant(inputStr, PVarchar.INSTANCE, sortOrder);
localeIsoCodeLiteral = LiteralExpression.newConstant(localeIsoCode, PVarchar.INSTANCE, sortOrder);
List<Expression> expressions = Lists.newArrayList((Expression) inputStrLiteral,
(Expression) localeIsoCodeLiteral);
Expression upperFunction = new UpperFunction(expressions);
ImmutableBytesWritable ptr = new ImmutableBytesWritable();
boolean ret = upperFunction.evaluate(null, ptr);
String result = ret
? (String) upperFunction.getDataType().toObject(ptr, upperFunction.getSortOrder()) : null;
return result;
}
}