Github user gatorsmile commented on a diff in the pull request:
https://github.com/apache/spark/pull/13415#discussion_r65266534
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/execution/SparkSqlParser.scala ---
@@ -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)
--- End diff --
I see. I can move it there.
The reason why I put here is because CTAS should not see the partitioning
columns. If we move there, we could issue this error message before the
expected message:
https://github.com/yhuai/spark/blob/fa8908122a238d6cdc0a9fc0f003221ef5601565/sql/core/src/main/scala/org/apache/spark/sql/execution/SparkSqlParser.scala#L940-L948
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]