Github user liancheng commented on a diff in the pull request:
https://github.com/apache/spark/pull/1919#discussion_r16340105
--- Diff: sql/hive/src/main/scala/org/apache/spark/SparkHadoopWriter.scala
---
@@ -93,6 +93,33 @@ private[hive] class SparkHiveHadoopWriter(
null)
}
+ def open(dynamicPartPath: String) {
+ val numfmt = NumberFormat.getInstance()
+ numfmt.setMinimumIntegerDigits(5)
+ numfmt.setGroupingUsed(false)
+
+ val extension = Utilities.getFileExtension(
+ conf.value,
+ fileSinkConf.getCompressed,
+ getOutputFormat())
+
+ val outputName = "part-" + numfmt.format(splitID) + extension
+ val outputPath: Path = FileOutputFormat.getOutputPath(conf.value)
+ if (outputPath == null) {
+ throw new IOException("Undefined job output-path")
+ }
+ val workPath = new Path(outputPath,
dynamicPartPath.substring(1))//remove "/"
+ val path = new Path(workPath, outputName)
+ getOutputCommitter().setupTask(getTaskContext())
+ writer = HiveFileFormatUtils.getHiveRecordWriter(
+ conf.value,
+ fileSinkConf.getTableInfo,
+ conf.value.getOutputValueClass.asInstanceOf[Class[Writable]],
+ fileSinkConf,
+ path,
+ null)
--- End diff --
Maybe `Reporter.NULL` instead of `null`.
---
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]