use of com.facebook.presto.pinot.PinotException in project presto by prestodb.
the class PinotProjectExpressionConverter method handleCast.
private PinotExpression handleCast(CallExpression cast, Map<VariableReferenceExpression, Selection> context) {
if (cast.getArguments().size() == 1) {
RowExpression input = cast.getArguments().get(0);
Type expectedType = cast.getType();
if (isImplicitCast(input.getType(), expectedType)) {
return input.accept(this, context);
}
throw new PinotException(PINOT_UNSUPPORTED_EXPRESSION, Optional.empty(), "Non implicit casts not supported: " + cast);
}
throw new PinotException(PINOT_UNSUPPORTED_EXPRESSION, Optional.empty(), format("This type of CAST operator not supported. Received: %s", cast));
}
use of com.facebook.presto.pinot.PinotException in project presto by prestodb.
the class TestPinotExpressionConverters method testFilterUnsupported.
private void testFilterUnsupported(String sqlExpression, SessionHolder sessionHolder) {
try {
RowExpression pushDownExpression = getRowExpression(sqlExpression, sessionHolder);
String actualPinotExpression = pushDownExpression.accept(new PinotFilterExpressionConverter(functionAndTypeManager, functionAndTypeManager, standardFunctionResolution), testInputFunction).getDefinition();
fail("expected to not reach here: Generated " + actualPinotExpression);
} catch (PinotException e) {
assertEquals(e.getErrorCode(), PINOT_UNSUPPORTED_EXPRESSION.toErrorCode());
}
}
Aggregations