@@ -160,7 +160,7 @@ case class CreateDataSourceTableAsSelectCommand(
160160
161161 if (existingTable.provider.get == DDLUtils .HIVE_PROVIDER ) {
162162 throw new AnalysisException (s " Saving data in the Hive serde table $tableName is " +
163- s " not supported yet. Please use the insertInto() API as an alternative. " )
163+ " not supported yet. Please use the insertInto() API as an alternative." )
164164 }
165165
166166 // Check if the specified data source match the data source of the existing table.
@@ -192,13 +192,18 @@ case class CreateDataSourceTableAsSelectCommand(
192192 }
193193 })
194194
195+ // In `AnalyzeCreateTable`, we verified the consistency between the user-specified table
196+ // definition(partition columns, bucketing) and the SELECT query, here we also need to
197+ // verify the the consistency between the user-specified table definition and the existing
198+ // table definition.
199+
195200 // Check if the specified partition columns match the existing table.
196201 val specifiedPartCols = CatalogUtils .normalizePartCols(
197202 tableName, tableCols, table.partitionColumnNames, resolver)
198203 if (specifiedPartCols != existingTable.partitionColumnNames) {
199204 throw new AnalysisException (
200205 s """
201- |Specified partitioning does not match the existing table $tableName.
206+ |Specified partitioning does not match that of the existing table $tableName.
202207 |Specified partition columns: [ ${specifiedPartCols.mkString(" , " )}]
203208 |Existing partition columns: [ ${existingTable.partitionColumnNames.mkString(" , " )}]
204209 """ .stripMargin)
@@ -215,7 +220,7 @@ case class CreateDataSourceTableAsSelectCommand(
215220 existingTable.bucketSpec.map(_.toString).getOrElse(" not bucketed" )
216221 throw new AnalysisException (
217222 s """
218- |Specified bucketing does not match the existing table $tableName.
223+ |Specified bucketing does not match that of the existing table $tableName.
219224 |Specified bucketing: $specifiedBucketString
220225 |Existing bucketing: $existingBucketString
221226 """ .stripMargin)
0 commit comments