Skip to content

Commit a145154

Browse files
committed
fix IT
Signed-off-by: xinyual <xinyual@amazon.com>
1 parent 3c48804 commit a145154

File tree

4 files changed

+6
-28
lines changed

4 files changed

+6
-28
lines changed

core/src/main/java/org/opensearch/sql/calcite/udf/textUDF/LocateFunction.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ public Object eval(Object... args) {
1414
return new IllegalArgumentException(
1515
"Invalid number of arguments, locate function expects 2 or 3 arguments");
1616
}
17-
String stringText = (String) args[0];
18-
String targetText = (String) args[1];
17+
String stringText = (String) args[1];
18+
String targetText = (String) args[0];
1919
if (stringText == null || targetText == null) {
2020
return null;
2121
}

core/src/main/java/org/opensearch/sql/calcite/utils/BuiltinFunctionUtils.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,9 @@ static List<RexNode> translateArgument(
243243
context.rexBuilder.makeLiteral(" ")));
244244
RTrimArgs.addAll(argList);
245245
return RTrimArgs;
246+
case "STRCMP":
247+
List<RexNode> StrcmpArgs = List.of(argList.get(1), argList.get(0));
248+
return StrcmpArgs;
246249
case "ATAN":
247250
List<RexNode> AtanArgs = new ArrayList<>(argList);
248251
if (AtanArgs.size() == 1) {

integ-test/src/test/java/org/opensearch/sql/calcite/remote/nonfallback/NonFallbackCalciteTextFunctionIT.java

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
package org.opensearch.sql.calcite.remote.nonfallback;
77

8-
import org.junit.Ignore;
98
import org.opensearch.sql.calcite.remote.fallback.CalciteTextFunctionIT;
109

1110
public class NonFallbackCalciteTextFunctionIT extends CalciteTextFunctionIT {
@@ -14,28 +13,4 @@ public void init() throws Exception {
1413
super.init();
1514
disallowCalciteFallback();
1615
}
17-
18-
@Ignore("https://github.com/opensearch-project/sql/issues/3467")
19-
@Override
20-
public void testAscii() {}
21-
22-
@Ignore("https://github.com/opensearch-project/sql/issues/3467")
23-
@Override
24-
public void testLeft() {}
25-
26-
@Ignore("https://github.com/opensearch-project/sql/issues/3467")
27-
@Override
28-
public void testLocate() {}
29-
30-
@Ignore("https://github.com/opensearch-project/sql/issues/3467")
31-
@Override
32-
public void testReplace() {}
33-
34-
@Ignore("https://github.com/opensearch-project/sql/issues/3467")
35-
@Override
36-
public void testStrcmp() {}
37-
38-
@Ignore("https://github.com/opensearch-project/sql/issues/3467")
39-
@Override
40-
public void testSubstr() {}
4116
}

integ-test/src/test/java/org/opensearch/sql/calcite/standalone/CalcitePPLStringBuiltinFunctionIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ public void testLocate() {
157157
JSONObject actual =
158158
executeQuery(
159159
String.format(
160-
"source=%s | where locate(name, 'Ja')=1 | fields name, age",
160+
"source=%s | where locate('Ja', name)=1 | fields name, age",
161161
TEST_INDEX_STATE_COUNTRY_WITH_NULL));
162162

163163
verifySchema(actual, schema("name", "string"), schema("age", "integer"));

0 commit comments

Comments
 (0)