use of io.crate.sql.tree.ComparisonExpression in project crate by crate.
the class TestStatementBuilder method testCaseSensitivity.
@Test
public void testCaseSensitivity() {
Expression expression = SqlParser.createExpression("\"firstName\" = 'myName'");
QualifiedNameReference nameRef = (QualifiedNameReference) ((ComparisonExpression) expression).getLeft();
StringLiteral myName = (StringLiteral) ((ComparisonExpression) expression).getRight();
assertThat(nameRef.getName().getSuffix(), is("firstName"));
assertThat(myName.getValue(), is("myName"));
expression = SqlParser.createExpression("FIRSTNAME = 'myName'");
nameRef = (QualifiedNameReference) ((ComparisonExpression) expression).getLeft();
assertThat(nameRef.getName().getSuffix(), is("firstname"));
expression = SqlParser.createExpression("ABS(1)");
QualifiedName functionName = ((FunctionCall) expression).getName();
assertThat(functionName.getSuffix(), is("abs"));
}
Aggregations