Skip to content

Conversation

@LantaoJin
Copy link
Member

@LantaoJin LantaoJin commented Sep 24, 2025

Description

  1. Set the default value of plugins.calcite.enabled to true
  2. Implicit to fallback to v2 for any failure with CalciteUnsupportException:
    https://github.com/opensearch-project/sql/blob/d6394dff93a2b8ae458137bfec8674dbfc0c6821/docs/user/ppl/limitations/limitations.rst#unsupported-functionalities-in-calcite-engine

Related Issues

Resolves #4314

Check List

  • New functionality includes testing.
  • New functionality has been documented.
  • New functionality has javadoc added.
  • New functionality has a user manual doc added.
  • New PPL command checklist all confirmed.
  • API changes companion pull request created.
  • Commits are signed per the DCO using --signoff or -s.
  • 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
Copy link
Member Author

LantaoJin commented Sep 25, 2025

RestHandlerClientYamlTestSuiteIT > test {yaml=issues/3102/Prevent push down limit if the offset reach max_result_window} FAILED
    java.lang.AssertionError: Failure at [issues/3102:26]: expected [2xx] status code but api [ppl] returned [500 Internal Server Error] [{
      "error": {
        "reason": "There was internal problem at backend",
        "details": "java.sql.SQLException: Error while preparing plan [LogicalSystemLimit(fetch=[10000], type=[QUERY_SIZE_LIMIT])\n  LogicalProject(id=[$0])\n    LogicalSort(offset=[1], fetch=[1])\n      CalciteLogicalIndexScan(table=[[OpenSearch, test]])\n]",
        "type": "RuntimeException"
      },
      "status": 500
    }]

This CI failure not related. It's a bug triggered by enabling Calcite. #4377 will fix it.

Signed-off-by: Lantao Jin <[email protected]>
@LantaoJin LantaoJin mentioned this pull request Sep 25, 2025
8 tasks
yuancu
yuancu previously approved these changes Sep 26, 2025
Copy link
Collaborator

@penghuo penghuo left a comment

Choose a reason for hiding this comment

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

We should remove combine ppl_cli and ppl_cli_calcite in category.json.

I see. it tracked in seperate PR. #4377


Limitations
===========
The ``information_schema`` command can only work with ``plugins.calcite.enabled=false``.
Copy link
Collaborator

Choose a reason for hiding this comment

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

information_schema is not a command. @vamsimanohar please help confirm. if it not not a command, we should remove it from command list.

Copy link
Member

Choose a reason for hiding this comment

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

You are right, its not a command. information_schema is a default schema for metadata information. ideally this should be part of describe command.
Lets remove it.
Prometheus is also moving to direct_query_plugin. Shouldn't be a big issue fi we remove it.

Copy link
Member Author

Choose a reason for hiding this comment

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

cmd/information_schema.rst was removed and its content was moved to ppl/admin/datasources.rst

Comment on lines +264 to +266
// We always allow fallback the query failed with CalciteUnsupportedException.
// This is for avoiding breaking changes when enable Calcite by default.
if (t instanceof CalciteUnsupportedException) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we have a list of command or common cases that may trigger fallback? Just a little concern the fallback logic become more complicated (Calcite -> V2 -> legacy).

Copy link
Member Author

@LantaoJin LantaoJin Sep 28, 2025

Choose a reason for hiding this comment

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

Do we have a list of command or common cases that may trigger fallback? Just a little concern the fallback logic become more complicated (Calcite -> V2 -> legacy).

Unsupported Functionalities in Calcite Engine

@yuancu yuancu merged commit b9e2761 into opensearch-project:main Sep 28, 2025
34 checks passed
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.19-dev failed:

The process '/usr/bin/git' failed with exit code 128

To backport manually, run these commands in your terminal:

# Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/sql/backport-2.19-dev 2.19-dev
# Navigate to the new working tree
pushd ../.worktrees/sql/backport-2.19-dev
# Create a new branch
git switch --create backport/backport-4372-to-2.19-dev
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 b9e2761a744b839d0edd86213b13a2cd89322787
# Push it to GitHub
git push --set-upstream origin backport/backport-4372-to-2.19-dev
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/sql/backport-2.19-dev

Then, create a pull request where the base branch is 2.19-dev and the compare/head branch is backport/backport-4372-to-2.19-dev.

LantaoJin added a commit to LantaoJin/search-plugins-sql that referenced this pull request Oct 9, 2025
…nds (opensearch-project#4372)

* Enable Calcite by default and implicit fallback the unsupported commands

Signed-off-by: Lantao Jin <[email protected]>

* Update docs

Signed-off-by: Lantao Jin <[email protected]>

* remove cmd/information_schema.rst file and move the content to ppl/admin/datasources.rst

Signed-off-by: Lantao Jin <[email protected]>

* remove information_schema.rst from category.json

Signed-off-by: Lantao Jin <[email protected]>

---------

Signed-off-by: Lantao Jin <[email protected]>
(cherry picked from commit b9e2761)
@LantaoJin LantaoJin added the backport-manually Filed a PR to backport manually. label Oct 9, 2025
LantaoJin added a commit that referenced this pull request Oct 9, 2025
…nds (#4372) (#4470)

* Enable Calcite by default and implicit fallback the unsupported commands



* Update docs



* remove cmd/information_schema.rst file and move the content to ppl/admin/datasources.rst



* remove information_schema.rst from category.json



---------


(cherry picked from commit b9e2761)

Signed-off-by: Lantao Jin <[email protected]>
asifabashar added a commit to asifabashar/sql that referenced this pull request Oct 10, 2025
* main-apple: (218 commits)
  Add ignorePrometheus Flag for integTest and docTest (opensearch-project#4442)
  Create fab-radar.yml
  PPL `fillnull` command enhancement (opensearch-project#4421)
  reverting to _doc + _id (opensearch-project#4435)
  Support `multisearch` command in calcite (opensearch-project#4332)
  Add 3.3 release notes (opensearch-project#4422) (opensearch-project#4423)
  [SQL/PPL] Fix the `count(*)` and `dc(field)` to be capped at MAX_INTEGER opensearch-project#4416 (opensearch-project#4418)
  Change the default search sort tiebreaker to `_shard_doc` for PIT search (opensearch-project#4378)
  [Enhancement] Add error handling for known limitation of sql `JOIN` (opensearch-project#4344)
  Bugfix: SQL type mapping for legacy JDBC output (opensearch-project#3613)
  Version bump: 3.3 (opensearch-project#4417)
  Add max/min eval functions (opensearch-project#4333)
  Support time modifiers in search command  (opensearch-project#4224)
  Fix numbered token bug and make it optional output in patterns command (opensearch-project#4402)
  refactor span (opensearch-project#4334)
  Move release notes categories (opensearch-project#3818)
  [Doc] Enable doctest with Calcite (opensearch-project#4379)
  Mod function should return decimal instead of float when handle the operands are decimal literal (opensearch-project#4407)
  Scale of decimal literal should always be positive in Calcite (opensearch-project#4401)
  Enable Calcite by default and implicit fallback the unsupported commands (opensearch-project#4372)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport 2.19-dev backport-failed backport-manually Filed a PR to backport manually. calcite calcite migration releated enhancement New feature or request v3.3.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Enable Calcite by default in 3.3.0

6 participants