result = new TypedFieldId(Types.required(MinorType.BIGINT), -5);
}
};
LogicalExpression functionCallExpr = new FunctionCall(FunctionDefinition.simple("testFunc",
new ArgumentValidator() {
@Override
public void validateArguments(ExpressionPosition expr, List<LogicalExpression> expressions,
ErrorCollector errors) {
errors.addGeneralError(expr, "Error!");
}
@Override
public String[] getArgumentNamesByPosition() {
return new String[0];
}
}, OutputTypeDeterminer.FIXED_BIT), ImmutableList.of((LogicalExpression) //
new FieldReference("test", ExpressionPosition.UNKNOWN) ), ExpressionPosition.UNKNOWN);
LogicalExpression newExpr = ExpressionTreeMaterializer.materialize(functionCallExpr, batch, ec);
assertTrue(newExpr instanceof FunctionCall);
FunctionCall funcExpr = (FunctionCall) newExpr;
assertEquals(1, funcExpr.args.size());
assertEquals(bigIntType, funcExpr.args.get(0).getMajorType());
assertEquals(1, ec.getErrorCount());
System.out.println(ec.toErrorString());
}