public void testNormalize() throws Exception {
List<Symbol> arguments = Arrays.<Symbol>asList(
Literal.newLiteral(new Integer[]{ 1, 2, 3 }, new ArrayType(DataTypes.INTEGER))
);
BytesRef[] expected = new BytesRef[]{ new BytesRef("1"), new BytesRef("2"), new BytesRef("3") };
Function function = createFunction(ToStringArrayFunction.NAME, new ArrayType(DataTypes.STRING), arguments);
ToStringArrayFunction arrayFunction = (ToStringArrayFunction) functions.get(function.info().ident());
Symbol result = arrayFunction.normalizeSymbol(function);
assertLiteralSymbol(result, expected, new ArrayType(DataTypes.STRING));
arguments.set(0, Literal.newLiteral(new Float[]{ 1.0f, 2.0f, 3.0f }, new ArrayType(DataTypes.FLOAT)));
expected = new BytesRef[]{ new BytesRef("1.0"), new BytesRef("2.0"), new BytesRef("3.0") };
function = createFunction(ToStringArrayFunction.NAME, new ArrayType(DataTypes.STRING), arguments);
arrayFunction = (ToStringArrayFunction) functions.get(function.info().ident());
result = arrayFunction.normalizeSymbol(function);
assertLiteralSymbol(result, expected, new ArrayType(DataTypes.STRING));
}