-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-29405][SQL] Alter table / Insert statements should not change a table's ownership #26068
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,6 +27,7 @@ import scala.collection.JavaConverters._ | |
| import scala.collection.mutable | ||
| import scala.collection.mutable.ArrayBuffer | ||
|
|
||
| import org.apache.commons.lang3.StringUtils | ||
| import org.apache.hadoop.fs.Path | ||
| import org.apache.hadoop.hive.common.StatsSetupConst | ||
| import org.apache.hadoop.hive.conf.HiveConf | ||
|
|
@@ -573,8 +574,9 @@ private[hive] class HiveClientImpl( | |
| // 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) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could we move this change to HiveClientImpl.scala#L1043? Option(table.owner).filter(_.nonEmpty).orElse(userName).foreach(hiveTable.setOwner)
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It sounds like a bigger deal than it is. Indeed, I am going to add
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hm, yea I think @wangyum's suggestion is more correct.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you @HyukjinKwon Fixed by #26160. |
||
| val hiveTable = toHiveTable( | ||
| table.copy(properties = table.ignoredProperties ++ table.properties), Some(userName)) | ||
| table.copy(properties = table.ignoredProperties ++ table.properties), Some(owner)) | ||
| // Do not use `table.qualifiedName` here because this may be a rename | ||
| val qualifiedTableName = s"$dbName.$tableName" | ||
| shim.alterTable(client, qualifiedTableName, hiveTable) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.