Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class PartitionsAlreadyExistException(message: String) extends AnalysisException

def this(tableName: String, partitionIdents: Seq[InternalRow], partitionSchema: StructType) = {
this(s"The following partitions already exists in table $tableName:" +
partitionIdents.map(_.toSeq(partitionSchema).zip(partitionSchema.map(_.name))
partitionIdents.map(id => partitionSchema.map(_.name).zip(id.toSeq(partitionSchema))
.map( kv => s"${kv._1} -> ${kv._2}").mkString(",")).mkString("\n===\n"))
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class AlterTableAddPartitionSuite
sql(s"ALTER TABLE $t ADD PARTITION (id=1) LOCATION 'loc'" +
" PARTITION (id=2) LOCATION 'loc1'")
}.getMessage
assert(errMsg === s"The following partitions already exists in table $t:2 -> id")
assert(errMsg === s"The following partitions already exists in table $t:id -> 2")

sql(s"ALTER TABLE $t ADD IF NOT EXISTS PARTITION (id=1) LOCATION 'loc'" +
" PARTITION (id=2) LOCATION 'loc1'")
Expand Down