Skip to content

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

Merged
LantaoJin merged 1 commit intoopensearch-project:mainfrom
xinyual:fixTextFunction
Mar 27, 2025
Merged

[Followup] fix text function IT for locate and strcmp#3482
LantaoJin merged 1 commit intoopensearch-project:mainfrom
xinyual:fixTextFunction

Conversation

@xinyual
Copy link
Copy Markdown
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 <xinyual@amazon.com>
@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
RTrimArgs.addAll(argList);
return RTrimArgs;
case "STRCMP":
List<RexNode> StrcmpArgs = List.of(argList.get(1), argList.get(0));
Copy link
Copy Markdown
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
Copy Markdown
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
penghuo pushed a commit that referenced this pull request Jun 16, 2025
Signed-off-by: xinyual <xinyual@amazon.com>
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