Github user cloud-fan commented on a diff in the pull request:
https://github.com/apache/spark/pull/7955#discussion_r36372012
--- Diff:
sql/hive/src/main/scala/org/apache/spark/sql/hive/hiveWriterContainers.scala ---
@@ -211,18 +211,18 @@ private[spark] class
SparkHiveDynamicPartitionWriterContainer(
}
}
- val dynamicPartPath = dynamicPartColNames
- .zip(row.toSeq.takeRight(dynamicPartColNames.length))
- .map { case (col, rawVal) =>
- val string = if (rawVal == null) null else
convertToHiveRawString(col, rawVal)
- val colString =
- if (string == null || string.isEmpty) {
- defaultPartName
- } else {
- FileUtils.escapePathName(string, defaultPartName)
- }
- s"/$col=$colString"
- }.mkString
+ val nonDynamicPartLen = schema.length - dynamicPartColNames.length
+ val dynamicPartPath = dynamicPartColNames.zipWithIndex.map { case
(colName, i) =>
+ val rawVal = row.get(nonDynamicPartLen + i, schema(colName).dataType)
--- End diff --
I followed the origin
code(`dynamicPartColNames.zip(row.toSeq.takeRight(dynamicPartColNames.length))`)
here, which seems assume the dynamic part is the right most part of this row.
Is this the right way to do?
cc @marmbrus
---
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]