Github user gatorsmile commented on a diff in the pull request:
https://github.com/apache/spark/pull/12801#discussion_r63018934
--- Diff:
sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveClientImpl.scala
---
@@ -405,20 +406,43 @@ private[hive] class HiveClientImpl(
ignoreIfNotExists: Boolean): Unit = withHiveState {
// TODO: figure out how to drop multiple partitions in one call
val hiveTable = client.getTable(db, table, true /* throw exception */)
- specs.foreach { s =>
- // The provided spec here can be a partial spec, i.e. it will match
all partitions
- // whose specs are supersets of this partial spec. E.g. If a table
has partitions
- // (b='1', c='1') and (b='1', c='2'), a partial spec of (b='1') will
match both.
- val matchingParts = client.getPartitions(hiveTable, s.asJava).asScala
- if (matchingParts.isEmpty && !ignoreIfNotExists) {
- throw new AnalysisException(
- s"partition to drop '$s' does not exist in table '$table'
database '$db'")
- }
- matchingParts.foreach { hivePartition =>
- val dropOptions = new PartitionDropOptions
- dropOptions.ifExists = ignoreIfNotExists
- client.dropPartition(db, table, hivePartition.getValues,
dropOptions)
+ // do the check at first and collect all the matching partitions
+ val matchingParts =
--- End diff --
So far, `InMemoryCatalog` does not correctly support partition dropping
with a partial spec.
---
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]