Skip to content
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

Support IF NOT EXISTS in create statement #42

Merged
merged 4 commits into from
Sep 28, 2023

Conversation

dai-chen
Copy link
Collaborator

@dai-chen dai-chen commented Sep 25, 2023

Description

Add IF NOT EXISTS in create index statement. This is useful along with checkpoint_location option introduced in #39. We just submit the exact same job (create with if not exists statement) to Spark to restart index refreshing, instead of submitting new job with REFRESH statement.

Doc: https://github.com/dai-chen/opensearch-spark/blob/support-if-not-exists/docs/index.md

Issues Resolved

#27

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.

@dai-chen dai-chen added the enhancement New feature or request label Sep 25, 2023
@dai-chen dai-chen self-assigned this Sep 25, 2023
@dai-chen dai-chen marked this pull request as ready for review September 25, 2023 17:51
@vmmusings
Copy link
Member

In general, what is preferred REFRESH INDEX statement or CREATE INDEX with IF NOT EXISTS.

@dai-chen
Copy link
Collaborator Author

dai-chen commented Sep 26, 2023

In general, what is preferred REFRESH INDEX statement or CREATE INDEX with IF NOT EXISTS.

I think run REFRESH statement directly is more clear. CREATE INDEX with IF NOT EXISTS is for use case that we just want to restart with same job code without looking into it. Anyway, this difference are only in SQL layer. In either case, only FlintSpark.refreshIndex API will be triggered underlying. Thanks!

@dai-chen dai-chen requested a review from vmmusings September 27, 2023 15:17
@dai-chen dai-chen merged commit 33a5f0a into opensearch-project:main Sep 28, 2023
4 checks passed
@dai-chen dai-chen deleted the support-if-not-exists branch September 28, 2023 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants