-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[Feature] Add feature to send session variables to JDBC external table #53358
base: main
Are you sure you want to change the base?
[Feature] Add feature to send session variables to JDBC external table #53358
Conversation
I will raise a new PR with documentation if this is accepted 🙏 |
Signed-off-by: Sophie Wang <[email protected]>
9a3f772
to
58501cd
Compare
…iables Signed-off-by: boosheen <[email protected]>
fe/fe-core/src/main/java/com/starrocks/planner/JDBCScanNode.java
Outdated
Show resolved
Hide resolved
fe/fe-core/src/main/java/com/starrocks/planner/JDBCScanNode.java
Outdated
Show resolved
Hide resolved
Quality Gate failedFailed conditions See analysis details on SonarQube Cloud Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE |
[Java-Extensions Incremental Coverage Report]✅ pass : 0 / 0 (0%) |
[BE Incremental Coverage Report]❌ fail : 0 / 6 (00.00%) file detail
|
Signed-off-by: Sophie Wang <[email protected]>
Signed-off-by: Sophie Wang <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: if there are more than one starrocks table in a query, which one should take the session variable?
Hi @zombee0 good question. By default, the session variables will be sent to all external tables with MySQL protocol in a query (based on the external resource connection pool). It makes the implementation and query syntax simpler for the end user, e.g. if they want to set the same sql_select_limit to all possible external tables I have considered adding support for user to specify specific resources to send session variables to, but that would be in a new feature/PR as the query input would be more complex. |
Why I'm doing:
I want to be able to send session variables to MySQL JDBC External tables.
This feature lets users send session variables to MySQL JDBC External Tables by setting a new session variable
jdbc_external_table_session_variables
.For example, running this query against external table
external_query_table
Will get translated to this query sent to the external table
Also added new property
DATABASE_TYPE
to JDBC external table resource creation. This way, we can detect if DATABASE_TYPE isstarrocks
and set user defined variables as well to target starrocks cluster (MySQL does not support user defined variable query hint).What I'm doing:
Fixes #53356
What type of PR is this:
Does this PR entail a change in behavior?
If yes, please specify the type of change:
Checklist:
Bugfix cherry-pick branch check: