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

Persisting runtime env info into Flint metadata #58

Merged
merged 2 commits into from
Oct 4, 2023

Conversation

dai-chen
Copy link
Collaborator

@dai-chen dai-chen commented Oct 3, 2023

Description

Persist env info in Flint metadata, such as EMR-S job info. We persist them for CREATE statement regardless of index options, such as auto_refresh.

TODO

  1. Refactor Flint metadata to de-dup serialization code in Refactoring Flint metadata and build index API #24
  2. Remove hardcoding env name in [FEATURE] Add Flint config for env to persist in metadata #59

Example

For EMR-S Spark:

# Skipping index test
CREATE SKIPPING INDEX ON myglue.default.http_logs (clientip VALUE_SET);

GET flint_myglue_default_http_logs_skipping_index/_mapping
{
    "mappings": {
      "_meta": {
        "kind": "skipping",
        "indexedColumns": 
        ...
        "source": "myglue.default.http_logs",
        "version": "0.1.0",
        "properties": {
          "env": {
            "SERVERLESS_EMR_VIRTUAL_CLUSTER_ID": "XXXXXX",
            "SERVERLESS_EMR_JOB_ID": "YYYYYY"
          }
        }
      },
      ...

# Covering index test
CREATE INDEX clientip_and_request ON default.http_logs_streaming (clientip, request);

GET flint_myglue_default_http_logs_streaming_clientip_and_request_index/_mapping
{
    "mappings": {
      "_meta": {
        "kind": "covering",
        "indexedColumns":
        ...
        "name": "clientip_and_request",
        "options": {},
        "source": "myglue.default.http_logs_streaming",
        "properties": {
          "env": {
            "SERVERLESS_EMR_VIRTUAL_CLUSTER_ID": "XXXXXX",
            "SERVERLESS_EMR_JOB_ID": "YYYYYY"
          }
        }
      },
      ...

For Non-EMR-S Spark, the properties should be empty without any env info:

spark-sql> CREATE SKIPPING INDEX ON myglue.stream.lineitem_tiny (l_shipdate VALUE_SET);

GET flint_myglue_stream_lineitem_tiny_skipping_index/_mapping
{
    "mappings": {
      "_meta": {
        "kind": "skipping",
        "indexedColumns":
        ...
        "source": "myglue.stream.lineitem_tiny",
        "version": "0.1.0",
        "properties": {}
      },
      ...

Issues Resolved

#57

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.

Signed-off-by: Chen Dai <daichen@amazon.com>
@dai-chen dai-chen added the enhancement New feature or request label Oct 3, 2023
@dai-chen dai-chen self-assigned this Oct 3, 2023
Signed-off-by: Chen Dai <daichen@amazon.com>
@dai-chen dai-chen marked this pull request as ready for review October 3, 2023 21:52
@dai-chen dai-chen changed the title Persist runtime env info into Flint metadata Persisting runtime env info into Flint metadata Oct 3, 2023
@penghuo penghuo merged commit 7044486 into opensearch-project:main Oct 4, 2023
4 checks passed
@dai-chen dai-chen deleted the persist-env-in-metadata branch October 4, 2023 15:33
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