use of io.confluent.ksql.engine.rewrite.StatementRewriteForMagicPseudoTimestamp in project ksql by confluentinc.
the class FilterTypeValidator method getExpressionReturnType.
private SqlType getExpressionReturnType(final Expression exp) {
final ExpressionTypeManager expressionTypeManager = new ExpressionTypeManager(schema, functionRegistry);
// Rewrite the expression with magic timestamps, so type checking can pass
final Expression magicTimestampRewrite = new StatementRewriteForMagicPseudoTimestamp().rewrite(exp);
try {
return expressionTypeManager.getExpressionSqlType(magicTimestampRewrite);
} catch (KsqlException e) {
throw new KsqlStatementException("Error in " + filterType.name() + " expression: " + e.getMessage(), exp.toString());
}
}
use of io.confluent.ksql.engine.rewrite.StatementRewriteForMagicPseudoTimestamp in project ksql by confluentinc.
the class PullQueryRewriter method rewrite.
public static Expression rewrite(final Expression expression) {
final Expression pseudoTimestamp = new StatementRewriteForMagicPseudoTimestamp().rewrite(expression);
final Expression betweenPredicatesRemoved = rewriteBetweenPredicates(pseudoTimestamp);
final Expression inPredicatesRemoved = rewriteInPredicates(betweenPredicatesRemoved);
return LogicRewriter.rewriteDNF(inPredicatesRemoved);
}
Aggregations