Uh oh!
There was an error while loading. Please reload this page.
[SPARK-29405][SQL] Alter table / Insert statements should not change a table's ownership - #26068
[SPARK-29405][SQL] Alter table / Insert statements should not change a table's ownership#26068yaooqinn wants to merge 5 commits into
Conversation
…a table's ownership
yaooqinn
commented
Oct 10, 2019
cc @wangyum |
wangyum
commented
Oct 12, 2019
retest this please |
SparkQA
commented
Oct 12, 2019
Test build #111952 has finished for PR 26068 at commit
|
SparkQA
commented
Oct 12, 2019
Test build #111964 has finished for PR 26068 at commit
|
| // If users explicitly alter these Hive-specific properties through ALTER TABLE DDL, we respect | ||
| // these user-specified values. | ||
| verifyColumnDataType(table.dataSchema) | ||
| val owner = Option(table.owner).filter(_.nonEmpty).getOrElse(userName) |
There was a problem hiding this comment.
Could we move this change to HiveClientImpl.scala#L1043?
Option(table.owner).filter(_.nonEmpty).orElse(userName).foreach(hiveTable.setOwner)There was a problem hiding this comment.
It sounds like a bigger deal than it is. Indeed, I am going to add alter table owner syntax, which may make this kind of change back and forth
There was a problem hiding this comment.
Hm, yea I think @wangyum's suggestion is more correct.
yaooqinn
commented
Oct 17, 2019
also cc @cloud-fan |
cloud-fan
commented
Oct 17, 2019
how is INSERT TABLE fixed in this PR? |
yaooqinn
commented
Oct 17, 2019
would eventually call alterTable here |
cloud-fan
commented
Oct 17, 2019
can we add a test in |
SparkQA
commented
Oct 17, 2019
Test build #112206 has finished for PR 26068 at commit
|
Uh oh!
There was an error while loading. Please reload this page.
wangyum
commented
Oct 17, 2019
To clarify, this PR fixed the case of |
SparkQA
commented
Oct 17, 2019
Test build #112215 has finished for PR 26068 at commit
|
SparkQA
commented
Oct 17, 2019
Test build #112214 has finished for PR 26068 at commit
|
cloud-fan
commented
Oct 18, 2019
thanks, merging to master! |
What changes were proposed in this pull request?
In this change, we give preference to the original table's owner if it is not empty.
Why are the changes needed?
When executing 'insert into/overwrite ...' DML, or 'alter table set tblproperties ...' DDL, spark would change the ownership of the table the one who runs the spark application.
Does this PR introduce any user-facing change?
NO
How was this patch tested?
Compare with the behavior of Apache Hive