Uh oh!
There was an error while loading. Please reload this page.
[SPARK-18042][SQL] OutputWriter should expose file path written - #15580
[SPARK-18042][SQL] OutputWriter should expose file path written#15580rxin wants to merge 3 commits into
Conversation
rxin
commented
Oct 21, 2016
and @ericl |
| * [[OutputCommitter]]. | ||
| */ | ||
| override def newWriter(path: String): OutputWriter = new OutputWriter { | ||
| override def newWriter(path1: String): OutputWriter = new OutputWriter { |
There was a problem hiding this comment.
how about _path? path1 looks weird...
There was a problem hiding this comment.
or maybe we can create a class for this OutputWriter here.
| new Path(stagingDir, fileNamePrefix + extension) | ||
| } | ||
| new ParquetOutputFormat[InternalRow]() { | ||
| override def getDefaultWorkFile(context: TaskAttemptContext, extension: String): Path = { |
There was a problem hiding this comment.
now we never use the context and extension parameters?
There was a problem hiding this comment.
I will add some documentation in my next pull request.
SparkQA
commented
Oct 21, 2016
Test build #67330 has finished for PR 15580 at commit
|
rxin
commented
Oct 21, 2016
cc @HyukjinKwon |
| * The path of the file to be written out. This path should include the staging directory and | ||
| * the file name prefix passed into the associated createOutputWriter function. | ||
| */ | ||
| def path: String |
SparkQA
commented
Oct 21, 2016
Test build #67344 has finished for PR 15580 at commit
|
ericl
commented
Oct 22, 2016
lgtm |
rxin
commented
Oct 22, 2016
Thanks - I'm going to merge this. I will address the doc and naming comment in the next pr in this series. |
| * Acceptable values are defined in [[shortParquetCompressionCodecNames]]. | ||
| */ | ||
| val compressionCodec: String = { | ||
| val compressionCodecClassName: String = { |
There was a problem hiding this comment.
@rxin This is a super minor but there are the same options to potentially rename in OrcOptions, JsonOptions, CSVOptions and TextFileFormat - TextFileFormat.scala#L71.
Also, I'd like to note, just in case, that the value in this is actually not the class name (it's something like SNAPPY and LZO) in case of ParquetOptions and OrcOptions whereas text-based ones are actual class names.
rxin
commented
Oct 22, 2016
@HyukjinKwon sure. |
## What changes were proposed in this pull request? This patch adds a new "path" method on OutputWriter that returns the path of the file written by the OutputWriter. This is part of the necessary work to consolidate structured streaming and batch write paths. The batch write path has a nice feature that each data source can define the extension of the files, and allow Spark to specify the staging directory and the prefix for the files. However, in the streaming path we need to collect the list of files written, and there is no interface right now to do that. ## How was this patch tested? N/A - there is no behavior change and this should be covered by existing tests. Author: Reynold Xin <rxin@databricks.com> Closesapache#15580 from rxin/SPARK-18042.
## What changes were proposed in this pull request? This patch adds a new "path" method on OutputWriter that returns the path of the file written by the OutputWriter. This is part of the necessary work to consolidate structured streaming and batch write paths. The batch write path has a nice feature that each data source can define the extension of the files, and allow Spark to specify the staging directory and the prefix for the files. However, in the streaming path we need to collect the list of files written, and there is no interface right now to do that. ## How was this patch tested? N/A - there is no behavior change and this should be covered by existing tests. Author: Reynold Xin <rxin@databricks.com> Closesapache#15580 from rxin/SPARK-18042.
What changes were proposed in this pull request?
This patch adds a new "path" method on OutputWriter that returns the path of the file written by the OutputWriter. This is part of the necessary work to consolidate structured streaming and batch write paths.
The batch write path has a nice feature that each data source can define the extension of the files, and allow Spark to specify the staging directory and the prefix for the files. However, in the streaming path we need to collect the list of files written, and there is no interface right now to do that.
How was this patch tested?
N/A - there is no behavior change and this should be covered by existing tests.