Commit c42fb7c
committed
fix(opensearch): revert arity-aware toOp; restore spath/JSON_EXTRACT doctest
The arity filter added to ExtendedRelJson.toOp in the previous commit broke
SAFE_CAST → JSON_EXTRACT deserialization (used by `spath` lowering): the
PPL JSON_EXTRACT UDF, registered as an anonymous UserDefinedFunctionBuilder
subclass, doesn't expose a meaningful getOperandCountRange(), so my filter
fell through to the firstKindMatch path and skipped the
AvaticaUtils.instantiatePlugin "class" path that previously resolved the
UDF. spath.md doctest started returning RuntimeException on
`source=structured | spath input=doc_n n | eval n=cast(n as int) | stats sum(n)`.
The RexStandardizer collapse (4-arg `REGEXP_REPLACE_PG_4(..., 'g')` → 3-arg
`REGEXP_REPLACE_3`) already fixes the patterns.md doctest at the source side
— by the time pushdown serialization runs, no 4-arg call exists for toOp to
disambiguate. The arity filter was defensive only and no longer carries its
weight; revert toOp to the original first-kind-match behavior, plus a spotless
re-flow that came in with the same change.
Verified locally on a fresh cluster:
- spath.md doctest query → returns sum(n)=6 (was 500).
- patterns.md doctest query → returns fully-tokenized aggregation rows.
- CalcitePPLDashboardPatternsIT → 1/1 PASS.
- CalcitePPLPatternsIT → 10/15 PASS (same baseline; same five known-pending
BRAIN failures tracked separately).
Signed-off-by: Kai Huang <ahkcs@amazon.com>1 parent 8720ca7 commit c42fb7c
2 files changed
Lines changed: 5 additions & 33 deletions
File tree
- opensearch/src/main/java/org/opensearch/sql/opensearch/storage/serde
Lines changed: 2 additions & 29 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
460 | 460 | | |
461 | 461 | | |
462 | 462 | | |
463 | | - | |
464 | | - | |
| 463 | + | |
465 | 464 | | |
466 | 465 | | |
467 | 466 | | |
| |||
554 | 553 | | |
555 | 554 | | |
556 | 555 | | |
557 | | - | |
558 | | - | |
559 | | - | |
560 | | - | |
561 | | - | |
562 | | - | |
563 | | - | |
564 | | - | |
565 | | - | |
566 | | - | |
567 | | - | |
568 | | - | |
569 | | - | |
570 | | - | |
571 | | - | |
572 | | - | |
573 | 556 | | |
574 | 557 | | |
575 | 558 | | |
| |||
583 | 566 | | |
584 | 567 | | |
585 | 568 | | |
586 | | - | |
587 | 569 | | |
588 | | - | |
589 | | - | |
590 | | - | |
591 | | - | |
592 | | - | |
593 | | - | |
594 | | - | |
| 570 | + | |
595 | 571 | | |
596 | 572 | | |
597 | 573 | | |
598 | | - | |
599 | | - | |
600 | | - | |
601 | 574 | | |
602 | 575 | | |
603 | 576 | | |
| |||
Lines changed: 3 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | | - | |
| 91 | + | |
| 92 | + | |
92 | 93 | | |
93 | | - | |
94 | | - | |
95 | | - | |
| 94 | + | |
96 | 95 | | |
97 | 96 | | |
98 | 97 | | |
| |||
0 commit comments