Skip to content

Commit 9025c6a

Browse files
committed
Replace locate udf with SqlStdOperatorTable.POSITION
Signed-off-by: Yuanchun Shen <yuanchu@amazon.com>
1 parent 856b83e commit 9025c6a

3 files changed

Lines changed: 1 addition & 60 deletions

File tree

core/src/main/java/org/opensearch/sql/expression/function/PPLBuiltinOperators.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151
import org.opensearch.sql.expression.function.udf.math.DivideFunction;
5252
import org.opensearch.sql.expression.function.udf.math.EulerFunction;
5353
import org.opensearch.sql.expression.function.udf.math.ModFunction;
54-
import org.opensearch.sql.expression.function.udf.text.LocateFunction;
5554

5655
/** Defines functions and operators that are implemented only by PPL */
5756
public class PPLBuiltinOperators extends ReflectiveSqlOperatorTable {
@@ -64,9 +63,6 @@ public class PPLBuiltinOperators extends ReflectiveSqlOperatorTable {
6463
public static final SqlOperator CRC32 = new CRC32Function().toUDF("CRC32");
6564
public static final SqlOperator DIVIDE = new DivideFunction().toUDF("DIVIDE");
6665

67-
// Text function
68-
public static final SqlOperator LOCATE = new LocateFunction().toUDF("LOCATE");
69-
7066
// Datetime function
7167
public static final SqlOperator TIMESTAMP = new TimestampFunction().toUDF("TIMESTAMP");
7268
public static final SqlOperator DATE =

core/src/main/java/org/opensearch/sql/expression/function/PPLFuncImpTable.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ void populate() {
171171
registerOperator(LENGTH, SqlStdOperatorTable.CHAR_LENGTH);
172172
registerOperator(LOWER, SqlStdOperatorTable.LOWER);
173173
registerOperator(POSITION, SqlStdOperatorTable.POSITION);
174+
registerOperator(LOCATE, SqlStdOperatorTable.POSITION);
174175
registerOperator(REPLACE, SqlStdOperatorTable.REPLACE);
175176
registerOperator(SUBSTRING, SqlStdOperatorTable.SUBSTRING);
176177
registerOperator(SUBSTR, SqlStdOperatorTable.SUBSTRING);
@@ -224,7 +225,6 @@ void populate() {
224225
registerOperator(MODULUSFUNCTION, PPLBuiltinOperators.MOD);
225226
registerOperator(CRC32, PPLBuiltinOperators.CRC32);
226227
registerOperator(DIVIDE, PPLBuiltinOperators.DIVIDE);
227-
registerOperator(LOCATE, PPLBuiltinOperators.LOCATE);
228228

229229
// Register PPL Datetime UDF operator
230230
registerOperator(TIMESTAMP, PPLBuiltinOperators.TIMESTAMP);

core/src/main/java/org/opensearch/sql/expression/function/udf/text/LocateFunction.java

Lines changed: 0 additions & 55 deletions
This file was deleted.

0 commit comments

Comments
 (0)