sql icon indicating copy to clipboard operation
sql copied to clipboard

Support two tables join PPL command

Open LantaoJin opened this issue 1 year ago • 1 comments

Description

This PR is the part 1 of supporting native join command. Check https://github.com/opensearch-project/sql/issues/2913 to get the whole implementation plan. This PR includes

  • In logical, support two-tables join PPL command with join type inner join, left join, semi join and anti join.
  • In physical, support hash join operator for equi-join, nested loop join operator for non-equi-join

This PR not includes

  • #2921
  • #2922
  • #2923
  • #2924
  • #2919

Syntax introduced in this PR

source=t1 | [joinType] JOIN t2 ON joinCriteria

joinType: INNER | LEFT [OUTER] | [LEFT] SEMI | [LEFT] ANTI

For example:

source=websites
| inner join access_log on websites.id=access_log.site_id
| fields websites.id, websites.name, access_log.count, access_log.date

source=websites
| left outer join access_log on id=site_id
| fields id, name, count, date

Related Issues

Resolves https://github.com/opensearch-project/sql/issues/2920 (part of https://github.com/opensearch-project/sql/issues/2913)

Check List

  • [x] New functionality includes testing.
  • [ ] New functionality has been documented.
  • [ ] New functionality has javadoc added.
  • [ ] New functionality has a user manual doc added.
  • [ ] API changes companion pull request created.
  • [x] Commits are signed per the DCO using --signoff.
  • [ ] Public documentation issue/PR created.

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.

LantaoJin avatar Aug 29 '24 14:08 LantaoJin

Current PR is ready for fundamental discussion. It contains basic implementation and unit tests. Integration tests and full test coverage hasn't been done.

LantaoJin avatar Sep 04 '24 15:09 LantaoJin

This PR is stalled because it has been open for 30 days with no activity.

@LantaoJin should we close this PR in favor of https://github.com/opensearch-project/sql/issues/3229

penghuo avatar Jan 15 '25 21:01 penghuo

@LantaoJin should we close this PR in favor of #3229

Sure, closed.

LantaoJin avatar Jan 16 '25 06:01 LantaoJin