-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-15676] [SQL] Disallow Column Names as Partition Columns For Hive Tables #13415
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 1 commit
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 |
|---|---|---|
|
|
@@ -937,7 +937,13 @@ class SparkSqlAstBuilder(conf: SQLConf) extends AstBuilder { | |
|
|
||
| selectQuery match { | ||
| case Some(q) => CreateTableAsSelectLogicalPlan(tableDesc, q, ifNotExists) | ||
| case None => CreateTableCommand(tableDesc, ifNotExists) | ||
| case None => | ||
| val partitionColsInTable = partitionCols.map(_.name).toSet.intersect(cols.map(_.name).toSet) | ||
| if (partitionColsInTable.nonEmpty) { | ||
| throw new ParseException(s"Column repeated in partitioning columns: " + | ||
| partitionColsInTable.mkString("[", ",", "]"), ctx) | ||
|
||
| } | ||
| CreateTableCommand(tableDesc, ifNotExists) | ||
| } | ||
| } | ||
|
|
||
|
|
||
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.
For CTAS, another PR (#13395) resolves the issue by disallowing users to specify
Partitioned Byclauses.