You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Apache Spark (JIRA)" <ji...@apache.org> on 2015/07/08 09:19:05 UTC

[jira] [Commented] (SPARK-8888) DynamicPartitionWriterContainer.outputWriterForRow is very inefficient

    [ https://issues.apache.org/jira/browse/SPARK-8888?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14618128#comment-14618128 ] 

Apache Spark commented on SPARK-8888:
-------------------------------------

User 'rxin' has created a pull request for this issue:
https://github.com/apache/spark/pull/7282

> DynamicPartitionWriterContainer.outputWriterForRow is very inefficient
> ----------------------------------------------------------------------
>
>                 Key: SPARK-8888
>                 URL: https://issues.apache.org/jira/browse/SPARK-8888
>             Project: Spark
>          Issue Type: Sub-task
>          Components: SQL
>            Reporter: Reynold Xin
>
> A few things:
> 1. We should use a java.util.HashMap, which is faster than Scala's map, although this one barely matters.
> 2. Don't use zip and scala collection methods to avoid garbage collection
> {code}
>     val partitionPath = partitionColumns.zip(row.toSeq).map { case (col, rawValue) =>
>       val string = if (rawValue == null) null else String.valueOf(rawValue)
>       val valueString = if (string == null || string.isEmpty) {
>         defaultPartitionName
>       } else {
>         PartitioningUtils.escapePathName(string)
>       }
>       s"/$col=$valueString"
>     }.mkString.stripPrefix(Path.SEPARATOR)
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org