-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-45454][SQL] Set the table's default owner to current_user #43264
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
Conversation
beliefer
left a comment
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.
LGTM if tests passed.
dongjoon-hyun
left a comment
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.
Could you re-trigger the failure pipelines, @wangyum ?
4c4566b to
7b811f2
Compare
dongjoon-hyun
left a comment
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.
+1, LGTM.
…ent_user (apache#268) [SPARK-45454][SQL] Set the table's default owner to current_user ### What changes were proposed in this pull request? This PR sets the table's default owner to `CURRENT_USER`. ### Why are the changes needed? In thrift server mode, the owner of the table is inconsistent with the `SELECT CURRENT_USER();`, the owner of the table is always the user who started the thrift server. ### Does this PR introduce _any_ user-facing change? The table owner may be changed to `CURRENT_USER`. For example: ``` Before this PR: yumwangG9L07H60PK spark-3.5.0-bin-hadoop3 % bin/beeline -u "jdbc:hive2://localhost:10000/" -n test_table_owner -e "create table t(id int) using parquet; desc formatted t;" | grep Owner Connecting to jdbc:hive2://localhost:10000/ Connected to: Spark SQL (version 3.5.0) Driver: Hive JDBC (version 2.3.9) Transaction isolation: TRANSACTION_REPEATABLE_READ No rows selected (0.36 seconds) No rows selected (0.1 seconds) | Owner | yumwang | | 16 rows selected (0.055 seconds) Beeline version 2.3.9 by Apache Hive Closing: 0: jdbc:hive2://localhost:10000/ After this PR: yumwangG9L07H60PK spark-4.0.0-SNAPSHOT-bin-3.3.6 % bin/beeline -u "jdbc:hive2://localhost:10000/" -n test_table_owner -e "create table t(id int) using parquet; desc formatted t;" | grep Owner Connecting to jdbc:hive2://localhost:10000/ Connected to: Spark SQL (version 4.0.0-SNAPSHOT) Driver: Hive JDBC (version 2.3.9) Transaction isolation: TRANSACTION_REPEATABLE_READ No rows selected (0.719 seconds) No rows selected (0.335 seconds) | Owner | test_table_owner | | 16 rows selected (0.065 seconds) Beeline version 2.3.9 by Apache Hive Closing: 0: jdbc:hive2://localhost:10000/ ``` ### How was this patch tested? Unit test and manual test. ### Was this patch authored or co-authored using generative AI tooling? No. Closes apache#43264 from wangyum/SPARK-45454. Authored-by: Yuming Wang <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]> (cherry picked from commit 4bad4b6)
What changes were proposed in this pull request?
This PR sets the table's default owner to
CURRENT_USER.Why are the changes needed?
In thrift server mode, the owner of the table is inconsistent with the
SELECT CURRENT_USER();, the owner of the table is always the user who started the thrift server.Does this PR introduce any user-facing change?
The table owner may be changed to
CURRENT_USER.For example:
How was this patch tested?
Unit test and manual test.
Was this patch authored or co-authored using generative AI tooling?
No.