Skip to content

Commit

Permalink
Boolean function in PPL should be case insensitive (#2758)
Browse files Browse the repository at this point in the history
Signed-off-by: Lantao Jin <[email protected]>
(cherry picked from commit 956ec15)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
github-actions[bot] committed Jul 18, 2024
1 parent 8856f85 commit 042ef09
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 042ef09

Please sign in to comment.