Github user rxin commented on a diff in the pull request:
https://github.com/apache/spark/pull/6610#discussion_r31878953
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/sources/PartitioningUtils.scala ---
@@ -179,19 +179,41 @@ private[sql] object PartitioningUtils {
* StringType
* }}}
*/
- private[sql] def resolvePartitions(values: Seq[PartitionValues]):
Seq[PartitionValues] = {
- // Column names of all partitions must match
- val distinctPartitionsColNames = values.map(_.columnNames).distinct
-
- if (distinctPartitionsColNames.isEmpty) {
+ private[sql] def resolvePartitions(
+ pathsWithPartitionValues: Seq[(Path, PartitionValues)]):
Seq[PartitionValues] = {
+ if (pathsWithPartitionValues.isEmpty) {
Seq.empty
} else {
- assert(distinctPartitionsColNames.size == 1, {
- val list = distinctPartitionsColNames.mkString("\t", "\n\t", "")
- s"Conflicting partition column names detected:\n$list"
- })
+ val distinctPartColNames =
pathsWithPartitionValues.map(_._2.columnNames).distinct
+
+ def listConflictingPartitionColumns: String = {
--- End diff --
move this out, make it accept arguments in the form of collections, and
write unit test for this function.
this function is way too complicated to not have unit tests.
---
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]