-
Notifications
You must be signed in to change notification settings - Fork 33
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
Translate PPL join
Command
#630
Conversation
Signed-off-by: Lantao Jin <[email protected]>
Signed-off-by: Lantao Jin <[email protected]>
Signed-off-by: Lantao Jin <[email protected]>
ppl-spark-integration/src/main/java/org/opensearch/sql/ppl/CatalystQueryPlanVisitor.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Lantao Jin <[email protected]>
Signed-off-by: Lantao Jin <[email protected]>
Signed-off-by: Lantao Jin <[email protected]>
Signed-off-by: Lantao Jin <[email protected]>
- Optional | ||
- Description: The type of join to perform. The default is `INNER` if not specified. | ||
|
||
**leftAlias** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit, if it is required field, why not using left and right, hint
seems optional field?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right. hint.
seems optional item. Using left
and right
sounds better. But it bring me that actually the alias also could be optional if users prefer to use pattern $table.$field
in join condition and no ambiguous naming related. For example:
SEARCH source=otel-v1-apm-span-000001
| <other PPL commands>
| LEFT JOIN
ON name = serviceName AND traceGroupName = 'client_cancel_order'
otel-v1-apm-service-map
| <other PPL commands>
Or ON otel-v1-apm-span-000001.name = otel-v1-apm-service-map.serviceName AND otel-v1-apm-service-map.traceGroupName = 'client_cancel_order'
Which solution do you prefer to? @penghuo
- Keep the alias name
hint.left
andhint.right
and set it to optional. - Remove the
hint.
prefix and keep it required.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO I would keep the existing first option
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@YANG-DB I found that the side aliases must be added as required because we add a SubqueryAlias
node for each side of the join.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doc updated. The hint.
is removed in latest commit.
Signed-off-by: Lantao Jin <[email protected]>
@YANG-DB This PR requires a |
Description
Syntax
Example of migration from SQL query (TPC-H Q13):
Rewritten by PPL Join query:
- Limitation: sub-searches is unsupported in join right side because sub-searches is unsupported in PPL
If sub-searches is supported in future, above ppl query could be rewritten as:
Issues Resolved
Resolves #619
Check List
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.