use of io.crate.sql.tree.MatchPredicate in project crate by crate.
the class TestStatementBuilder method testSafeSubscriptExpression.
@Test
public void testSafeSubscriptExpression() {
MatchPredicate matchPredicate = (MatchPredicate) SqlParser.createExpression("match (a['1']['2'], 'abc')");
assertThat(matchPredicate.idents().get(0).columnIdent().toString(), is("\"a\"['1']['2']"));
matchPredicate = (MatchPredicate) SqlParser.createExpression("match (a['1']['2']['4'], 'abc')");
assertThat(matchPredicate.idents().get(0).columnIdent().toString(), is("\"a\"['1']['2']['4']"));
assertThrows(ParsingException.class, () -> SqlParser.createExpression("match ([1]['1']['2'], 'abc')"), "mismatched input '<EOF>' expecting 'SET'");
}
Aggregations