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

Add OpenSearchTable in flint core #479

Merged
merged 6 commits into from
Aug 6, 2024

Conversation

penghuo
Copy link
Collaborator

@penghuo penghuo commented Jul 25, 2024

Description

  1. Deprecated scroll api with search_after api.
  2. Deprecated createReader function from FlintClient and add Table/OpenSearchIndexTable in FlintCore. OpenSearchIndexTable will be the high level interface of FlintCore. Table will be high level interface of FlintCore which is independent of query engine.
  3. Perf result
SQL Query PR search_after on shard (ms) PIT on Shard with Search_After (ms)
SELECT COUNT(*) FROM dev.default.logs-181998 17021.0 18256.0
SELECT COUNT(*) FROM dev.default.logs-181998 WHERE status <> 0 18507.0 18247.0
SELECT COUNT(*), AVG(size) FROM dev.default.logs-181998 18281.0 19951.0
SELECT AVG(CAST(size AS BIGINT)) FROM dev.default.logs-181998 19109.0 19719.0
SELECT MIN(@timestamp), MAX(@timestamp) FROM dev.default.logs-181998 18420.0 20459.0
SELECT status, COUNT() FROM dev.default.logs-181998 WHERE status <> 0 GROUP BY status ORDER BY COUNT() DESC 19731.0 20686.0

Issues Resolved

#494

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.

penghuo added 3 commits July 25, 2024 14:13
Signed-off-by: Peng Huo <penghuo@gmail.com>
Signed-off-by: Peng Huo <penghuo@gmail.com>
Signed-off-by: Peng Huo <penghuo@gmail.com>
@penghuo penghuo changed the title add opensearch table in core add OpenSearchTable in flint core Jul 26, 2024
@penghuo penghuo mentioned this pull request Jul 26, 2024
10 tasks
@penghuo penghuo marked this pull request as ready for review July 26, 2024 15:14
@penghuo penghuo changed the title add OpenSearchTable in flint core Add OpenSearchTable in flint core Jul 26, 2024
@penghuo penghuo self-assigned this Jul 26, 2024
@penghuo penghuo added the 0.5 label Jul 26, 2024
Comment on lines +123 to +126
val SUPPORT_SHARD = FlintConfig(s"spark.datasource.flint.${FlintOptions.SUPPORT_SHARD}")
.datasourceOption()
.doc("indicate does index support shard or not")
.createWithDefault(String.valueOf(FlintOptions.DEFAULT_SUPPORT_SHARD))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this new option for testing or some use case? Does this actually mean if the OpenSearch table is partitioned or not?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This describes whether the OpenSearch index supports sharding. The reason is that OpenSearch serverless does not support sharding.
Currently, a table's partition is determined by the partition, but there is no hard limit.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally, we should remove this setting. However, currently, the AOSS index settings return shard information, so we cannot distinguish it.

{
    "settings": {
      "index": {
        "number_of_shards": "2",
        "number_of_replicas": "0",
      }
    }
  }
}

penghuo added 3 commits August 5, 2024 08:44
Signed-off-by: Peng Huo <penghuo@gmail.com>
Signed-off-by: Peng Huo <penghuo@gmail.com>
Copy link
Collaborator

@dai-chen dai-chen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the changes!

@penghuo penghuo merged commit 7b52d81 into opensearch-project:main Aug 6, 2024
4 checks passed
@penghuo penghuo deleted the pr-SearchAfter branch August 6, 2024 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants