-
Notifications
You must be signed in to change notification settings - Fork 181
Support UNION RECURSIVE in OpenSearch PPL #5027
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Caution Review failedThe pull request is closed. 📝 WalkthroughSummary by CodeRabbitRelease NotesNew Features
Documentation
✏️ Tip: You can customize this high-level summary in your review settings. WalkthroughImplements UNION RECURSIVE support in OpenSearch PPL, adding grammar, AST nodes, visitors, Calcite translation with schema validation, recursive relation scoping, and comprehensive tests spanning core, PPL, and integration layers. Changes
Sequence Diagram(s)sequenceDiagram
participant Parser as PPL Parser
participant Validator as UnionRecursiveValidator
participant Analyzer as Analyzer
participant Calcite as CalciteRelNodeVisitor
participant Context as CalcitePlanContext
Parser->>Parser: Parse UNION RECURSIVE<br/>create UnionRecursive AST
Parser->>Validator: validate(recursiveSubsearch,<br/>relationName)
Validator->>Validator: Traverse plan tree<br/>check recursive reference
alt Validation fails
Validator->>Parser: throw SemanticCheckException
else Validation succeeds
Validator-->>Parser: validation complete
end
Parser->>Analyzer: analyze(UnionRecursive)
alt Non-Calcite engine
Analyzer->>Analyzer: throw getOnlyForCalciteException
else Calcite engine
Analyzer-->>Calcite: proceed to translation
end
Calcite->>Context: pushRecursiveRelation(name,<br/>rowType)
Context-->>Calcite: recursive scope established
Calcite->>Calcite: Visit anchor block<br/>construct RelNode
Calcite->>Calcite: Visit recursive block<br/>rewrite recursive relation<br/>to transientScan
Calcite->>Calcite: validateUnionRecursiveSchema<br/>(anchorRowType,<br/>recursiveRowType)
alt Schema mismatch
Calcite->>Calcite: throw SemanticCheckException
else Schema matches
Calcite->>Calcite: construct RepeatUnion
end
alt max_rows specified
Calcite->>Calcite: wrap with LogicalSystemLimit
end
Calcite->>Context: popRecursiveRelation()
Context-->>Calcite: scope closed
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested labels
Suggested reviewers
✨ Finishing touches
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (27)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Description
[Describe what this change achieves]
Related Issues
Resolves #[Issue number to be closed when this PR is merged]
Check List
--signoffor-s.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.