You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/10/16 19:44:05 UTC

[GitHub] [spark] MaxGekk opened a new pull request #30069: [MINOR][SQL] Re-use `binaryToSQLTimestamp()` in `ParquetRowConverter`

MaxGekk opened a new pull request #30069:
URL: https://github.com/apache/spark/pull/30069


   ### What changes were proposed in this pull request?
   The function `binaryToSQLTimestamp()` is used by Parquet Vectorized reader. Parquet MR reader has similar code for de-serialization of INT96 timestamps. In this PR, I propose to de-duplicate code and re-use `binaryToSQLTimestamp()`.
   
   ### Why are the changes needed?
   This should improve maintenance, and should allow to avoid errors while changing Vectorized and regular parquet readers. 
   
   ### Does this PR introduce _any_ user-facing change?
   No
   
   ### How was this patch tested?
   By existing test suites, for instance `ParquetIOSuite`.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] SparkQA commented on pull request #30069: [MINOR][SQL] Re-use `binaryToSQLTimestamp()` in `ParquetRowConverter`

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #30069:
URL: https://github.com/apache/spark/pull/30069#issuecomment-710728885


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


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] SparkQA commented on pull request #30069: [MINOR][SQL] Re-use `binaryToSQLTimestamp()` in `ParquetRowConverter`

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #30069:
URL: https://github.com/apache/spark/pull/30069#issuecomment-710516751


   **[Test build #129913 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/129913/testReport)** for PR 30069 at commit [`f80ab26`](https://github.com/apache/spark/commit/f80ab264f2b4994a40e7987c0244d0c7c81c062d).


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] dongjoon-hyun commented on a change in pull request #30069: [MINOR][SQL] Re-use `binaryToSQLTimestamp()` in `ParquetRowConverter`

Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on a change in pull request #30069:
URL: https://github.com/apache/spark/pull/30069#discussion_r506688087



##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetRowConverter.scala
##########
@@ -300,15 +300,7 @@ private[parquet] class ParquetRowConverter(
         new ParquetPrimitiveConverter(updater) {
           // Converts nanosecond timestamps stored as INT96
           override def addBinary(value: Binary): Unit = {
-            assert(
-              value.length() == 12,
-              "Timestamps (with nanoseconds) are expected to be stored in 12-byte long binaries, " +
-              s"but got a ${value.length()}-byte binary.")

Review comment:
       ~Shall we keep this assertion? Or, is it checked inside `binaryToSQLTimestamp` already?~
   Got it. I checked.
   ```
     def binaryToSQLTimestamp(binary: Binary): Long = {
       assert(binary.length() == 12, s"Timestamps (with nanoseconds) are expected to be stored in" +
         s" 12-byte long binaries. Found a ${binary.length()}-byte binary instead.")
       val buffer = binary.toByteBuffer.order(ByteOrder.LITTLE_ENDIAN)
       val timeOfDayNanos = buffer.getLong
       val julianDay = buffer.getInt
       DateTimeUtils.fromJulianDay(julianDay, timeOfDayNanos)
     }
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] dongjoon-hyun commented on a change in pull request #30069: [MINOR][SQL] Re-use `binaryToSQLTimestamp()` in `ParquetRowConverter`

Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on a change in pull request #30069:
URL: https://github.com/apache/spark/pull/30069#discussion_r506688087



##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetRowConverter.scala
##########
@@ -300,15 +300,7 @@ private[parquet] class ParquetRowConverter(
         new ParquetPrimitiveConverter(updater) {
           // Converts nanosecond timestamps stored as INT96
           override def addBinary(value: Binary): Unit = {
-            assert(
-              value.length() == 12,
-              "Timestamps (with nanoseconds) are expected to be stored in 12-byte long binaries, " +
-              s"but got a ${value.length()}-byte binary.")

Review comment:
       Shall we keep this assertion?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] SparkQA removed a comment on pull request #30069: [MINOR][SQL] Re-use `binaryToSQLTimestamp()` in `ParquetRowConverter`

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #30069:
URL: https://github.com/apache/spark/pull/30069#issuecomment-710516751


   **[Test build #129913 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/129913/testReport)** for PR 30069 at commit [`f80ab26`](https://github.com/apache/spark/commit/f80ab264f2b4994a40e7987c0244d0c7c81c062d).


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] AmplabJenkins commented on pull request #30069: [MINOR][SQL] Re-use `binaryToSQLTimestamp()` in `ParquetRowConverter`

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #30069:
URL: https://github.com/apache/spark/pull/30069#issuecomment-710614284






----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] dongjoon-hyun commented on a change in pull request #30069: [MINOR][SQL] Re-use `binaryToSQLTimestamp()` in `ParquetRowConverter`

Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on a change in pull request #30069:
URL: https://github.com/apache/spark/pull/30069#discussion_r506688087



##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetRowConverter.scala
##########
@@ -300,15 +300,7 @@ private[parquet] class ParquetRowConverter(
         new ParquetPrimitiveConverter(updater) {
           // Converts nanosecond timestamps stored as INT96
           override def addBinary(value: Binary): Unit = {
-            assert(
-              value.length() == 12,
-              "Timestamps (with nanoseconds) are expected to be stored in 12-byte long binaries, " +
-              s"but got a ${value.length()}-byte binary.")

Review comment:
       Shall we keep this assertion? Or, is it checked inside `binaryToSQLTimestamp` already?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] AmplabJenkins commented on pull request #30069: [MINOR][SQL] Re-use `binaryToSQLTimestamp()` in `ParquetRowConverter`

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #30069:
URL: https://github.com/apache/spark/pull/30069#issuecomment-710729385






----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] dongjoon-hyun closed pull request #30069: [MINOR][SQL] Re-use `binaryToSQLTimestamp()` in `ParquetRowConverter`

Posted by GitBox <gi...@apache.org>.
dongjoon-hyun closed pull request #30069:
URL: https://github.com/apache/spark/pull/30069


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] dongjoon-hyun commented on a change in pull request #30069: [MINOR][SQL] Re-use `binaryToSQLTimestamp()` in `ParquetRowConverter`

Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on a change in pull request #30069:
URL: https://github.com/apache/spark/pull/30069#discussion_r506688087



##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetRowConverter.scala
##########
@@ -300,15 +300,7 @@ private[parquet] class ParquetRowConverter(
         new ParquetPrimitiveConverter(updater) {
           // Converts nanosecond timestamps stored as INT96
           override def addBinary(value: Binary): Unit = {
-            assert(
-              value.length() == 12,
-              "Timestamps (with nanoseconds) are expected to be stored in 12-byte long binaries, " +
-              s"but got a ${value.length()}-byte binary.")

Review comment:
       ~Shall we keep this assertion? Or, is it checked inside `binaryToSQLTimestamp` already?~
   Got it. I checked.
   ```sack
     def binaryToSQLTimestamp(binary: Binary): Long = {
       assert(binary.length() == 12, s"Timestamps (with nanoseconds) are expected to be stored in" +
         s" 12-byte long binaries. Found a ${binary.length()}-byte binary instead.")
       val buffer = binary.toByteBuffer.order(ByteOrder.LITTLE_ENDIAN)
       val timeOfDayNanos = buffer.getLong
       val julianDay = buffer.getInt
       DateTimeUtils.fromJulianDay(julianDay, timeOfDayNanos)
     }
   ```

##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetRowConverter.scala
##########
@@ -300,15 +300,7 @@ private[parquet] class ParquetRowConverter(
         new ParquetPrimitiveConverter(updater) {
           // Converts nanosecond timestamps stored as INT96
           override def addBinary(value: Binary): Unit = {
-            assert(
-              value.length() == 12,
-              "Timestamps (with nanoseconds) are expected to be stored in 12-byte long binaries, " +
-              s"but got a ${value.length()}-byte binary.")

Review comment:
       ~Shall we keep this assertion? Or, is it checked inside `binaryToSQLTimestamp` already?~
   Got it. I checked.
   ```scala
     def binaryToSQLTimestamp(binary: Binary): Long = {
       assert(binary.length() == 12, s"Timestamps (with nanoseconds) are expected to be stored in" +
         s" 12-byte long binaries. Found a ${binary.length()}-byte binary instead.")
       val buffer = binary.toByteBuffer.order(ByteOrder.LITTLE_ENDIAN)
       val timeOfDayNanos = buffer.getLong
       val julianDay = buffer.getInt
       DateTimeUtils.fromJulianDay(julianDay, timeOfDayNanos)
     }
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] SparkQA commented on pull request #30069: [MINOR][SQL] Re-use `binaryToSQLTimestamp()` in `ParquetRowConverter`

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #30069:
URL: https://github.com/apache/spark/pull/30069#issuecomment-710569313


   Kubernetes integration test starting
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/34519/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] AmplabJenkins removed a comment on pull request #30069: [MINOR][SQL] Re-use `binaryToSQLTimestamp()` in `ParquetRowConverter`

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #30069:
URL: https://github.com/apache/spark/pull/30069#issuecomment-710729385






----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] SparkQA commented on pull request #30069: [MINOR][SQL] Re-use `binaryToSQLTimestamp()` in `ParquetRowConverter`

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #30069:
URL: https://github.com/apache/spark/pull/30069#issuecomment-710614234


   Kubernetes integration test status failure
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/34519/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] AmplabJenkins removed a comment on pull request #30069: [MINOR][SQL] Re-use `binaryToSQLTimestamp()` in `ParquetRowConverter`

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #30069:
URL: https://github.com/apache/spark/pull/30069#issuecomment-710614293


   Test FAILed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/34519/
   Test FAILed.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] AmplabJenkins removed a comment on pull request #30069: [MINOR][SQL] Re-use `binaryToSQLTimestamp()` in `ParquetRowConverter`

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #30069:
URL: https://github.com/apache/spark/pull/30069#issuecomment-710614284


   Merged build finished. Test FAILed.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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