Github user sameeragarwal commented on a diff in the pull request:
https://github.com/apache/spark/pull/14607#discussion_r75537591
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/execution/command/ddl.scala ---
@@ -518,21 +550,87 @@ case class AlterTableRecoverPartitionsCommand(
// TODO: Validate the value
val value = PartitioningUtils.unescapePathName(ps(1))
// comparing with case-insensitive, but preserve the case
- if (columnName == partitionNames(0)) {
- scanPartitions(
- spark, fs, filter, st.getPath, spec ++ Map(columnName ->
value), partitionNames.drop(1))
+ if (columnName == partitionNames.head) {
+ scanPartitions(spark, fs, filter, st.getPath, spec ++
Map(columnName -> value),
+ partitionNames.drop(1), threshold)
} else {
- logWarning(s"expect partition column ${partitionNames(0)}, but
got ${ps(0)}, ignore it")
+ logWarning(s"expect partition column ${partitionNames.head}, but
got ${ps(0)}, ignore it")
Seq()
}
} else {
- if (name != "_SUCCESS" && name != "_temporary" &&
!name.startsWith(".")) {
- logWarning(s"ignore ${new Path(path, name)}")
- }
+ logWarning(s"ignore ${new Path(path, name)}")
Seq()
}
}
}
+
+ private def gatherPartitionStats(
+ spark: SparkSession,
+ partitionSpecsAndLocs: GenSeq[(TablePartitionSpec, Path)],
+ fs: FileSystem,
+ pathFilter: PathFilter,
+ threshold: Int): GenMap[String, (Int, Long)] = {
--- End diff --
perhaps wrap (Int, Long) into a `PartitionStatistics` case class?
---
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]