Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Followup] fix text function IT for locate and strcmp #3482

Merged
merged 1 commit into from
Mar 27, 2025

Conversation

xinyual
Copy link
Contributor

@xinyual xinyual commented Mar 26, 2025

Description

fix text function IT for locate and strcmp, also, enable nonfallback IT.
All calcite IT pass:
./gradlew :integ-test:integTest --tests '*Calcite*IT'

Related Issues

Resolves #3481

Check List

  • New functionality includes testing.
  • New functionality has been documented.
  • New functionality has javadoc added.
  • New functionality has a user manual doc added.
  • API changes companion pull request created.
  • Commits are signed per the DCO using --signoff.
  • Public documentation issue/PR created.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: xinyual <[email protected]>
@LantaoJin LantaoJin changed the title fix text function IT for locate and strcmp [Followup] fix text function IT for locate and strcmp Mar 26, 2025
@LantaoJin LantaoJin added testing Related to improving software testing calcite calcite migration releated labels Mar 26, 2025
@@ -243,6 +243,9 @@ static List<RexNode> translateArgument(
context.rexBuilder.makeLiteral(" ")));
RTrimArgs.addAll(argList);
return RTrimArgs;
case "STRCMP":
List<RexNode> StrcmpArgs = List.of(argList.get(1), argList.get(0));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just wonder why some function's arguments are swapped in this method?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's because the order in compareTo between V2 and Calcite is different:
V2:

Integer.compare(str1.stringValue().compareTo(str2.stringValue()), 0)))

Calcite

return (int) Math.signum(s1.compareTo(s0));

@LantaoJin LantaoJin merged commit fd41858 into opensearch-project:main Mar 27, 2025
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
calcite calcite migration releated testing Related to improving software testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[TEST] CalciteTextFunctionIT didn't pass CI
3 participants