Skip to content

Commit b5e8e53

Browse files
committed
peng - make extract multi to only handle the case of max_match > 1
Signed-off-by: Jialiang Liang <jiallian@amazon.com>
1 parent a8df4e7 commit b5e8e53

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

core/src/main/java/org/opensearch/sql/calcite/CalciteRelNodeVisitor.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,7 @@ public RelNode visitRex(Rex node, CalcitePlanContext context) {
228228

229229
for (int i = 0; i < namedGroups.size(); i++) {
230230
RexNode extractCall;
231-
if (node.getMaxMatch().isPresent() && node.getMaxMatch().get() != 1) {
232-
// Use REX_EXTRACT_MULTI for multiple matches
231+
if (node.getMaxMatch().isPresent() && node.getMaxMatch().get() > 1) {
233232
extractCall =
234233
PPLFuncImpTable.INSTANCE.resolve(
235234
context.rexBuilder,
@@ -239,7 +238,6 @@ public RelNode visitRex(Rex node, CalcitePlanContext context) {
239238
context.relBuilder.literal(i + 1),
240239
context.relBuilder.literal(node.getMaxMatch().get()));
241240
} else {
242-
// Use REX_EXTRACT for single match (default)
243241
extractCall =
244242
PPLFuncImpTable.INSTANCE.resolve(
245243
context.rexBuilder,

0 commit comments

Comments
 (0)