Github user NathanHowell commented on a diff in the pull request:

    https://github.com/apache/spark/pull/16089#discussion_r90488454
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/text/TextFileFormat.scala
 ---
    @@ -132,39 +128,17 @@ class TextOutputWriter(
         context: TaskAttemptContext)
       extends OutputWriter {
     
    -  private[this] val buffer = new Text()
    -
    -  private val recordWriter: RecordWriter[NullWritable, Text] = {
    -    new TextOutputFormat[NullWritable, Text]() {
    -      override def getDefaultWorkFile(context: TaskAttemptContext, 
extension: String): Path = {
    -        new Path(path)
    -      }
    -    }.getRecordWriter(context)
    -  }
    +  private val writer = CodecStreams.getOutputStream(context, new 
Path(path))
     
       override def write(row: Row): Unit = throw new 
UnsupportedOperationException("call writeInternal")
     
       override protected[sql] def writeInternal(row: InternalRow): Unit = {
         val utf8string = row.getUTF8String(0)
    -    buffer.set(utf8string.getBytes)
    -    recordWriter.write(NullWritable.get(), buffer)
    +    writer.write(utf8string.getBytes)
    --- End diff --
    
    Done, but I'm not 100% sure about the implementation. Can you have someone 
more familiar with `UTF8String`'s internals double check it?


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to