use of io.confluent.ksql.parser.tree.HoppingWindowExpression in project ksql by confluentinc.
the class AstBuilder method visitWindowExpression.
@Override
public Node visitWindowExpression(SqlBaseParser.WindowExpressionContext ctx) {
String windowName = DEFAULT_WINDOW_NAME;
if (ctx.IDENTIFIER() != null) {
windowName = ctx.IDENTIFIER().getText();
}
windowName = windowName.toUpperCase();
if (ctx.tumblingWindowExpression() != null) {
TumblingWindowExpression tumblingWindowExpression = (TumblingWindowExpression) visitTumblingWindowExpression(ctx.tumblingWindowExpression());
return new WindowExpression(windowName, tumblingWindowExpression);
} else if (ctx.hoppingWindowExpression() != null) {
HoppingWindowExpression hoppingWindowExpression = (HoppingWindowExpression) visitHoppingWindowExpression(ctx.hoppingWindowExpression());
return new WindowExpression(windowName, hoppingWindowExpression);
} else if (ctx.sessionWindowExpression() != null) {
SessionWindowExpression sessionWindowExpression = (SessionWindowExpression) visitSessionWindowExpression(ctx.sessionWindowExpression());
return new WindowExpression(windowName, sessionWindowExpression);
}
throw new KsqlException("Window description is not correct.");
}
Aggregations