Skip to content

Commit 17bd91d

Browse files
committed
Add more PR review feedback
Signed-off-by: Margarit Hakobyan <[email protected]>
1 parent f4ee6d0 commit 17bd91d

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

core/src/main/java/org/opensearch/sql/expression/text/TextFunction.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,9 @@ private DefaultFunctionResolver locate() {
251251
*/
252252
private DefaultFunctionResolver position() {
253253
return define(BuiltinFunctionName.POSITION.getName(),
254-
impl(nullMissingHandling(TextFunction::exprPosition), INTEGER, STRING, STRING));
254+
impl(nullMissingHandling(
255+
(SerializableBiFunction<ExprValue, ExprValue, ExprValue>)
256+
TextFunction::exprLocate), INTEGER, STRING, STRING));
255257
}
256258

257259
/**
@@ -326,10 +328,6 @@ private static ExprValue exprLocate(ExprValue subStr, ExprValue str, ExprValue p
326328
str.stringValue().indexOf(subStr.stringValue(), pos.integerValue() - 1) + 1);
327329
}
328330

329-
private static ExprValue exprPosition(ExprValue subStr, ExprValue str) {
330-
return exprLocate(subStr, str);
331-
}
332-
333331
private static ExprValue exprReplace(ExprValue str, ExprValue from, ExprValue to) {
334332
return new ExprStringValue(str.stringValue().replaceAll(from.stringValue(), to.stringValue()));
335333
}

0 commit comments

Comments
 (0)