Github user liancheng commented on a diff in the pull request: https://github.com/apache/spark/pull/13756#discussion_r69541158 --- Diff: sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/rules.scala --- @@ -206,7 +207,39 @@ private[sql] case class PreWriteCheck(conf: SQLConf, catalog: SessionCatalog) // The relation in l is not an InsertableRelation. failAnalysis(s"$l does not allow insertion.") + case c: CreateTableCommand => + val allColNamesInSchema = c.table.schema.map(_.name) + val colNames = allColNamesInSchema.diff(c.table.partitionColumnNames) + val partitionColumnNames = c.table.partitionColumnNames + // Duplicates are not allowed in partitionBy + // Todo: when bucketBy and sortBy are supported, we also need to ban the duplication. + checkDuplicates(partitionColumnNames, "Partition") + // Ensuring whether no duplicate name is used in table definition + checkDuplicates(colNames, s"table definition of ${c.table.identifier}") + // For non-data-source tables, partition columns must not be part of the schema + val badPartCols = partitionColumnNames.toSet.intersect(colNames.toSet) --- End diff -- Again, this line is using case sensitive comparison.
--- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org