Skip to content
Closed
Changes from 1 commit
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
Prev Previous commit
address comments
  • Loading branch information
cloud-fan committed Nov 8, 2016
commit 0c18e279f29986263d6057ed0d76112412510be5
Original file line number Diff line number Diff line change
Expand Up @@ -355,14 +355,16 @@ case class TruncateTableCommand(
table.identifier.quotedString,
spark.sessionState.conf.resolver)
}
val parts =
val partLocations =
catalog.listPartitions(table.identifier, normalizedSpec).map(_.storage.locationUri)

for (spec <- partitionSpec if parts.isEmpty && spec.size == partCols.length) {
// Fail if the partition spec is fully specified (not partial) and the partition does not
// exist.
for (spec <- partitionSpec if partLocations.isEmpty && spec.size == partCols.length) {
throw new NoSuchPartitionException(table.database, table.identifier.table, spec)
}

parts
partLocations
}
val hadoopConf = spark.sessionState.newHadoopConf()
locations.foreach { location =>
Expand Down