Skip to content

Commit

Permalink
Boolean function in PPL should be case insensitive
Browse files Browse the repository at this point in the history
Signed-off-by: Lantao Jin <[email protected]>
  • Loading branch information
LantaoJin committed Jun 17, 2024
1 parent 7b40c2c commit f1760f9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ public UnresolvedExpression visitTakeAggFunctionCall(
/** Eval function. */
@Override
public UnresolvedExpression visitBooleanFunctionCall(BooleanFunctionCallContext ctx) {
final String functionName = ctx.conditionFunctionBase().getText();
final String functionName = ctx.conditionFunctionBase().getText().toLowerCase();
return buildFunction(
FUNCTION_NAME_MAPPING.getOrDefault(functionName, functionName),
ctx.functionArgs().functionArg());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,15 @@ public void testLogicalLikeExpr() {
@Test
public void testBooleanIsNullFunction() {
assertEqual("source=t isnull(a)", filter(relation("t"), function("is null", field("a"))));
assertEqual("source=t ISNULL(a)", filter(relation("t"), function("is null", field("a"))));
}

@Test
public void testBooleanIsNotNullFunction() {
assertEqual(
"source=t isnotnull(a)", filter(relation("t"), function("is not null", field("a"))));
assertEqual(
"source=t ISNOTNULL(a)", filter(relation("t"), function("is not null", field("a"))));
}

/** Todo. search operator should not include functionCall, need to change antlr. */
Expand Down

0 comments on commit f1760f9

Please sign in to comment.