You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by dongjoon-hyun <gi...@git.apache.org> on 2017/12/06 08:48:51 UTC

[GitHub] spark pull request #19907: [SPARK-22712][SQL] Use `buildReaderWithPartitionV...

GitHub user dongjoon-hyun opened a pull request:

    https://github.com/apache/spark/pull/19907

    [SPARK-22712][SQL] Use `buildReaderWithPartitionValues` in native OrcFileFormat

    ## What changes were proposed in this pull request?
    
    To support vectorization in native OrcFileFormat later, we need to use `buildReaderWithPartitionValues` instead of `buildReader` like ParquetFileFormat. This PR replaces `buildReader` with `buildReaderWithPartitionValues`.
    
    ## How was this patch tested?
    
    Pass the Jenkins with the existing test cases.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/dongjoon-hyun/spark SPARK-ORC-BUILD-READER

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/19907.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #19907
    
----
commit 199c835d429e16108f4d45730c66512b2889d150
Author: Dongjoon Hyun <do...@apache.org>
Date:   2017-12-06T08:42:22Z

    [SPARK-22712][SQL] Use `buildReaderWithPartitionValues` in native OrcFileFormat

----


---

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


[GitHub] spark issue #19907: [SPARK-22712][SQL] Use `buildReaderWithPartitionValues` ...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/19907
  
    **[Test build #84570 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/84570/testReport)** for PR 19907 at commit [`f69fc4e`](https://github.com/apache/spark/commit/f69fc4e740609900760f43a1855eb283a6afab1a).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---

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


[GitHub] spark issue #19907: [SPARK-22712][SQL] Use `buildReaderWithPartitionValues` ...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/19907
  
    Merged build finished. Test PASSed.


---

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


[GitHub] spark issue #19907: [SPARK-22712][SQL] Use `buildReaderWithPartitionValues` ...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/19907
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/84543/
    Test PASSed.


---

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


[GitHub] spark pull request #19907: [SPARK-22712][SQL] Use `buildReaderWithPartitionV...

Posted by dongjoon-hyun <gi...@git.apache.org>.
Github user dongjoon-hyun commented on a diff in the pull request:

    https://github.com/apache/spark/pull/19907#discussion_r155313387
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcFileFormat.scala ---
    @@ -167,8 +169,10 @@ class OrcFileFormat
             val iter = new RecordReaderIterator[OrcStruct](orcRecordReader)
             Option(TaskContext.get()).foreach(_.addTaskCompletionListener(_ => iter.close()))
     
    -        val unsafeProjection = UnsafeProjection.create(requiredSchema)
    -        val deserializer = new OrcDeserializer(dataSchema, requiredSchema, requestedColIds)
    +        val colIds = requestedColIds ++ List.fill(partitionSchema.length)(-1).toArray[Int]
    +        val unsafeProjection = UnsafeProjection.create(resultSchema)
    --- End diff --
    
    Oh, I see. you meant non-vectorized path. Sorry, I was confused since I focused too much on vectorized path. I'll do.


---

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


[GitHub] spark issue #19907: [SPARK-22712][SQL] Use `buildReaderWithPartitionValues` ...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/19907
  
    **[Test build #84543 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/84543/testReport)** for PR 19907 at commit [`199c835`](https://github.com/apache/spark/commit/199c835d429e16108f4d45730c66512b2889d150).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---

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


[GitHub] spark issue #19907: [SPARK-22712][SQL] Use `buildReaderWithPartitionValues` ...

Posted by cloud-fan <gi...@git.apache.org>.
Github user cloud-fan commented on the issue:

    https://github.com/apache/spark/pull/19907
  
    thanks, merging to master!


---

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


[GitHub] spark issue #19907: [SPARK-22712][SQL] Use `buildReaderWithPartitionValues` ...

Posted by dongjoon-hyun <gi...@git.apache.org>.
Github user dongjoon-hyun commented on the issue:

    https://github.com/apache/spark/pull/19907
  
    Hi, @gatorsmile .
    Could you review this, too?


---

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


[GitHub] spark pull request #19907: [SPARK-22712][SQL] Use `buildReaderWithPartitionV...

Posted by dongjoon-hyun <gi...@git.apache.org>.
Github user dongjoon-hyun commented on a diff in the pull request:

    https://github.com/apache/spark/pull/19907#discussion_r155312307
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcFileFormat.scala ---
    @@ -167,8 +169,10 @@ class OrcFileFormat
             val iter = new RecordReaderIterator[OrcStruct](orcRecordReader)
             Option(TaskContext.get()).foreach(_.addTaskCompletionListener(_ => iter.close()))
     
    -        val unsafeProjection = UnsafeProjection.create(requiredSchema)
    -        val deserializer = new OrcDeserializer(dataSchema, requiredSchema, requestedColIds)
    +        val colIds = requestedColIds ++ List.fill(partitionSchema.length)(-1).toArray[Int]
    +        val unsafeProjection = UnsafeProjection.create(resultSchema)
    --- End diff --
    
    Parquet Vectorization work like the following.
    ```
          // UnsafeRowParquetRecordReader appends the columns internally to avoid another copy.
          if (parquetReader.isInstanceOf[VectorizedParquetRecordReader] &&
              enableVectorizedReader) {
            iter.asInstanceOf[Iterator[InternalRow]]
    ```


---

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


[GitHub] spark issue #19907: [SPARK-22712][SQL] Use `buildReaderWithPartitionValues` ...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/19907
  
    Merged build finished. Test PASSed.


---

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


[GitHub] spark issue #19907: [SPARK-22712][SQL] Use `buildReaderWithPartitionValues` ...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/19907
  
    **[Test build #84570 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/84570/testReport)** for PR 19907 at commit [`f69fc4e`](https://github.com/apache/spark/commit/f69fc4e740609900760f43a1855eb283a6afab1a).


---

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


[GitHub] spark issue #19907: [SPARK-22712][SQL] Use `buildReaderWithPartitionValues` ...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/19907
  
    **[Test build #84543 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/84543/testReport)** for PR 19907 at commit [`199c835`](https://github.com/apache/spark/commit/199c835d429e16108f4d45730c66512b2889d150).


---

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


[GitHub] spark pull request #19907: [SPARK-22712][SQL] Use `buildReaderWithPartitionV...

Posted by cloud-fan <gi...@git.apache.org>.
Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/19907#discussion_r155213150
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcFileFormat.scala ---
    @@ -167,8 +169,10 @@ class OrcFileFormat
             val iter = new RecordReaderIterator[OrcStruct](orcRecordReader)
             Option(TaskContext.get()).foreach(_.addTaskCompletionListener(_ => iter.close()))
     
    -        val unsafeProjection = UnsafeProjection.create(requiredSchema)
    -        val deserializer = new OrcDeserializer(dataSchema, requiredSchema, requestedColIds)
    +        val colIds = requestedColIds ++ List.fill(partitionSchema.length)(-1).toArray[Int]
    +        val unsafeProjection = UnsafeProjection.create(resultSchema)
    --- End diff --
    
    can we follow parquet and just join the data row and partition row, and do a final unsafe projection? It's much easier and there is no performance difference.


---

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


[GitHub] spark pull request #19907: [SPARK-22712][SQL] Use `buildReaderWithPartitionV...

Posted by dongjoon-hyun <gi...@git.apache.org>.
Github user dongjoon-hyun commented on a diff in the pull request:

    https://github.com/apache/spark/pull/19907#discussion_r155175104
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcFileFormat.scala ---
    @@ -124,7 +124,7 @@ class OrcFileFormat
         true
       }
     
    -  override def buildReader(
    +  override def buildReaderWithPartitionValues(
    --- End diff --
    
    Hi, @cloud-fan . During the previous ORC PR, we left this behind.


---

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


[GitHub] spark issue #19907: [SPARK-22712][SQL] Use `buildReaderWithPartitionValues` ...

Posted by dongjoon-hyun <gi...@git.apache.org>.
Github user dongjoon-hyun commented on the issue:

    https://github.com/apache/spark/pull/19907
  
    Thank you, @cloud-fan !


---

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


[GitHub] spark pull request #19907: [SPARK-22712][SQL] Use `buildReaderWithPartitionV...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/spark/pull/19907


---

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


[GitHub] spark issue #19907: [SPARK-22712][SQL] Use `buildReaderWithPartitionValues` ...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/19907
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/84570/
    Test PASSed.


---

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