use of io.crate.sql.tree.LikePredicate in project crate by crate.
the class AstBuilder method visitLike.
@Override
public Node visitLike(SqlBaseParser.LikeContext context) {
Expression escape = null;
if (context.escape != null) {
escape = (Expression) visit(context.escape);
}
boolean ignoreCase = context.LIKE() == null && context.ILIKE() != null;
Expression result = new LikePredicate((Expression) visit(context.value), (Expression) visit(context.pattern), escape, ignoreCase);
if (context.NOT() != null) {
result = new NotExpression(result);
}
return result;
}
Aggregations