Skip to content

Conversation

@penghuo
Copy link
Collaborator

@penghuo penghuo commented Apr 9, 2025

Description

  1. Enable update calcite setting through _plugins/_query/settings API
  2. Add follow up task to enable DocTest on setting. [FEATURE] Enable doctest on Lookup/Join/Subquery #3533

Tests

  • calcite default disabled
### Query
POST {{baseUrl}}/_plugins/_ppl/_explain
Content-Type: application/x-ndjson

{
    "query": "source=test00001"
}

### Response
{
  "root": {
    "name": "ProjectOperator",
    "description": {
      "fields": "[]"
    },
    "children": [
      {
        "name": "OpenSearchIndexScan",
        "description": {
          "request": "OpenSearchQueryRequest(indexName=test00001, sourceBuilder={\"from\":0,\"size\":10000,\"timeout\":\"1m\",\"_source\":{\"includes\":[],\"excludes\":[]}}, needClean=true, searchDone=false, pitId=null, cursorKeepAlive=null, searchAfter=null, searchResponse=null)"
        },
        "children": []
      }
    ]
  }
}
  • enable calcite
### enable calcite
PUT {{baseUrl}}/_plugins/_query/settings
Content-Type: application/x-ndjson

{
  "transient" : {
    "plugins.calcite.enabled" : true
  }
}

### explain
POST {{baseUrl}}/_plugins/_ppl/_explain
Content-Type: application/x-ndjson

{
    "query": "source=test00001"
}

{
  "calcite": {
    "logical": "CalciteLogicalIndexScan(table=[[OpenSearch, test00001]])\n",
    "physical": "CalciteEnumerableIndexScan(table=[[OpenSearch, test00001]])\n"
  }
}

Related Issues

#3530

Check List

  • 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.
  • 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.

Signed-off-by: Peng Huo <penghuo@gmail.com>
Copy link
Collaborator

@noCharger noCharger left a comment

Choose a reason for hiding this comment

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

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 fix!

@penghuo
Copy link
Collaborator Author

penghuo commented Apr 9, 2025

Non-blocking: add IT similiar as https://github.com/opensearch-project/sql/blob/main/integ-test/src/test/java/org/opensearch/sql/legacy/PluginIT.java#L34

Agree, track in #3533. It should covered by docTest also.

@penghuo penghuo merged commit ab3d8a7 into opensearch-project:main Apr 9, 2025
22 checks passed
penghuo added a commit that referenced this pull request Jun 16, 2025
…3531)

Signed-off-by: Peng Huo <penghuo@gmail.com>
Signed-off-by: xinyual <xinyual@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants