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

Query rewriter plugin - design only #24509

Open
wants to merge 1 commit into
base: ibm
Choose a base branch
from

Conversation

ScrapCodes
Copy link

@ScrapCodes ScrapCodes commented Feb 6, 2025

Description

Provide the ability to provide external query rewriters, through the plugin mechanism.

Motivation and Context

Rewriters can run some sql -> sql rewrite and perform optimization.

Impact

Feature is hidden behind a session flag, and once enabled, allows an external query rewriter to rewrite the SQL query.

Test Plan

Added tests in presto-tests.

Contributor checklist

  • Please make sure your submission complies with our contributing guide, in particular code style and commit standards.
  • PR description addresses the issue accurately and concisely. If the change is non-trivial, a GitHub Issue is referenced.
  • Documented new properties (with its default value), SQL syntax, functions, or other functionality.
  • If release notes are required, they follow the release notes guidelines.
  • Adequate tests were added if applicable.
  • CI passed.

Release Notes

Please follow release notes guidelines and fill in the release notes below.

== RELEASE NOTES ==

General Changes
* Query rewriter plugin, can be enabled or disabled via a session flag `is_query_rewriter_plugin_enabled`

@prestodb-ci prestodb-ci added the from:IBM PR from IBM label Feb 6, 2025
import java.util.Map;
import java.util.Optional;

public class QueryAndSessionProperties
Copy link
Author

Choose a reason for hiding this comment

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

This is done differently, the reason is we have SessionBuilder at dispatchManager, which can directly set the required properties.

@ScrapCodes ScrapCodes marked this pull request as ready for review February 6, 2025 17:31
@ScrapCodes ScrapCodes requested a review from presto-oss February 6, 2025 17:31
@ScrapCodes ScrapCodes changed the base branch from master to ibm February 6, 2025 17:35
@ScrapCodes
Copy link
Author

Spark integration test failures, does not seem to be related to the PR. Can take a closer look later.

@yingsu00 yingsu00 self-requested a review February 11, 2025 22:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
from:IBM PR from IBM
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants