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/11/30 12:58:23 UTC

[GitHub] [spark] sarutak opened a new pull request #30546: [SPARK-33607][SS][WEBUI] Input Rate isn't rendered if built with Scala 2.13

sarutak opened a new pull request #30546:
URL: https://github.com/apache/spark/pull/30546


   ### What changes were proposed in this pull request?
   <!--
   Please clarify what changes you are proposing. The purpose of this section is to outline the changes and how this PR fixes the issue. 
   If possible, please consider writing useful notes for better and faster reviews in your PR. See the examples below.
     1. If you refactor some codes with changing classes, showing the class hierarchy will help reviewers.
     2. If you fix some SQL features, you can provide some references of other DBMSes.
     3. If there is design documentation, please add the link.
     4. If there is a discussion in the mailing list, please add the link.
   -->
   This PR fix an issue that the histogram and timeline doesn't rendered in the `Streaming Query Statistics` page if we built Spark with Scala 2.13.
   
   ![before-fix-the-issue](https://user-images.githubusercontent.com/4736016/100612855-f543d700-3356-11eb-90d9-ede57b8b3f4f.png)
   ![NaN_Error](https://user-images.githubusercontent.com/4736016/100612879-00970280-3357-11eb-97cf-43978bbe2d3a.png)
   
   
   The reason is [`maxRecordRate` can be `NaN`](https://github.com/apache/spark/blob/master/sql/core/src/main/scala/org/apache/spark/sql/streaming/ui/StreamingQueryStatisticsPage.scala#L371) for Scala 2.13.
   
   The `NaN` is the result of [`query.recentProgress.map(_.inputRowsPerSecond).max`](https://github.com/apache/spark/blob/master/sql/core/src/main/scala/org/apache/spark/sql/streaming/ui/StreamingQueryStatisticsPage.scala#L372) when the first element of `query.recentProgress.map(_.inputRowsPerSecond)` is `NaN`.
   Actually, the comparison logic for `Double` type was changed in Scala 2.13.
   https://github.com/scala/bug/issues/12107
   https://github.com/scala/scala/pull/6410
   
   So this issue happens as of Scala 2.13.
   
   The root cause of the `NaN` is [here](https://github.com/apache/spark/blob/master/sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/ProgressReporter.scala#L164).
   This `NaN` seems to be an initial value of `inputTimeSec` so I think `Double`.PositiveInfinity` is suitable rather than `NaN` and this change can resolve this issue.
   
   ### Why are the changes needed?
   <!--
   Please clarify why the changes are needed. For instance,
     1. If you propose a new API, clarify the use case for a new API.
     2. If you fix a bug, you can clarify why it is a bug.
   -->
   To make sure we can use the histogram/timeline with Scala 2.13.
   
   ### Does this PR introduce _any_ user-facing change?
   <!--
   Note that it means *any* user-facing change including all aspects such as the documentation fix.
   If yes, please clarify the previous behavior and the change this PR proposes - provide the console output, description and/or an example to show the behavior difference if possible.
   If possible, please also clarify if this is a user-facing change compared to the released Spark versions or within the unreleased branches such as master.
   If no, write 'No'.
   -->
   No.
   
   ### How was this patch tested?
   <!--
   If tests were added, say they were added here. Please make sure to add some test cases that check the changes thoroughly including negative and positive cases if possible.
   If it was tested in a way different from regular unit tests, please clarify how you tested step by step, ideally copy and paste-able, so that other reviewers can test and check, and descendants can verify in the future.
   If tests were not added, please describe why they were not added and/or why it was difficult to add.
   -->
   First, I built with the following commands.
   ```
   $ /dev/change-scala-version.sh 2.13
   $ build/sbt -Phive -Phive-thriftserver -Pscala-2.13 package
   ```
   
   Then, ran the following query (this is brought from #30427 ).
   ```
   import org.apache.spark.sql.streaming.Trigger
   val query = spark
     .readStream
     .format("rate")
     .option("rowsPerSecond", 1000)
     .option("rampUpTime", "10s")
     .load()
     .selectExpr("*", "CAST(CAST(timestamp AS BIGINT) - CAST((RAND() * 100000) AS BIGINT) AS TIMESTAMP) AS tsMod")
     .selectExpr("tsMod", "mod(value, 100) as mod", "value")
     .withWatermark("tsMod", "10 seconds")
     .groupBy(window($"tsMod", "1 minute", "10 seconds"), $"mod")
     .agg(max("value").as("max_value"), min("value").as("min_value"), avg("value").as("avg_value"))
     .writeStream
     .format("console")
     .trigger(Trigger.ProcessingTime("5 seconds"))
     .outputMode("append")
     .start()
   ```
   
   Finally, I confirmed that the timeline and histogram are rendered.
   ![after-fix-the-issue](https://user-images.githubusercontent.com/4736016/100612736-c9285600-3356-11eb-856d-7e53cc656c36.png)
   
   
   
   ```


----------------------------------------------------------------
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 #30546: [SPARK-33607][SS][WEBUI] Input Rate timeline/histogram aren't rendered if built with Scala 2.13

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






----------------------------------------------------------------
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 #30546: [SPARK-33607][SS][WEBUI] Input Rate timeline/histogram aren't rendered if built with Scala 2.13

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


   **[Test build #131986 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/131986/testReport)** for PR 30546 at commit [`cecf62f`](https://github.com/apache/spark/commit/cecf62f4796a681ecc05560f611c919cdb0a5a7e).
    * 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] HeartSaVioR edited a comment on pull request #30546: [SPARK-33607][SS][WEBUI] Input Rate timeline/histogram aren't rendered if built with Scala 2.13

Posted by GitBox <gi...@apache.org>.
HeartSaVioR edited a comment on pull request #30546:
URL: https://github.com/apache/spark/pull/30546#issuecomment-736064915


   Nice finding! Is the calculation `numRecords / inputTimeSec (= Double.PositiveInfinity)` consistent between 2.12 and 2.13? I guess you've experimented for both versions, but just to confirm again.


----------------------------------------------------------------
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] sarutak commented on pull request #30546: [SPARK-33607][SS][WEBUI] Input Rate timeline/histogram aren't rendered if built with Scala 2.13

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


   @srowen 
   > I only wonder if this value is used elsewhere where a big positive value is unexpected.
   
   `inputTimeSec` is a local val and it's used only for `numRecords / inputTimeSec` so I believe this change doesn't affect elsewhere.
   
   @HeartSaVioR 
   > Is the calculation numRecords / inputTimeSec (= Double.PositiveInfinity) consistent between 2.12 and 2.13? I guess you've experimented for both versions, but just to confirm again.
   
   Yes, I have confirmed the result of `numRecords / Double.PositiveInfinity` is zero for both 2.12 and 2.13.


----------------------------------------------------------------
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] HeartSaVioR commented on pull request #30546: [SPARK-33607][SS][WEBUI] Input Rate timeline/histogram aren't rendered if built with Scala 2.13

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


   This is a single line change, and both Jenkins and GA passed. Merging to master (as Scala 2.13 compatible doesn't look to be a target for 3.0.x)


----------------------------------------------------------------
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] HeartSaVioR edited a comment on pull request #30546: [SPARK-33607][SS][WEBUI] Input Rate timeline/histogram aren't rendered if built with Scala 2.13

Posted by GitBox <gi...@apache.org>.
HeartSaVioR edited a comment on pull request #30546:
URL: https://github.com/apache/spark/pull/30546#issuecomment-736180446


   This is a single line change, and both Jenkins and GA passed. Merging to master. (I'll skip porting back as Scala 2.13 compatible doesn't look to be a target for 3.0.x.)


----------------------------------------------------------------
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] HeartSaVioR closed pull request #30546: [SPARK-33607][SS][WEBUI] Input Rate timeline/histogram aren't rendered if built with Scala 2.13

Posted by GitBox <gi...@apache.org>.
HeartSaVioR closed pull request #30546:
URL: https://github.com/apache/spark/pull/30546


   


----------------------------------------------------------------
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 #30546: [SPARK-33607][SS][WEBUI] Input Rate timeline/histogram aren't rendered if built with Scala 2.13

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






----------------------------------------------------------------
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] srowen commented on pull request #30546: [SPARK-33607][SS][WEBUI] Input Rate timeline/histogram aren't rendered if built with Scala 2.13

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


   Seems reasonable to me, unless there's a clean way to handle NaN. I only wonder if this value is used elsewhere where a big positive value is unexpected.


----------------------------------------------------------------
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 #30546: [SPARK-33607][SS][WEBUI] Input Rate timeline/histogram aren't rendered if built with Scala 2.13

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






----------------------------------------------------------------
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] HeartSaVioR commented on pull request #30546: [SPARK-33607][SS][WEBUI] Input Rate timeline/histogram aren't rendered if built with Scala 2.13

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


   Nice finding! Is the calculation `numRecords / inputTimeSec` consistent between 2.12 and 2.13? I guess you've experimented for both versions, but just to confirm again.


----------------------------------------------------------------
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 #30546: [SPARK-33607][SS][WEBUI] Input Rate timeline/histogram aren't rendered if built with Scala 2.13

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


   **[Test build #131986 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/131986/testReport)** for PR 30546 at commit [`cecf62f`](https://github.com/apache/spark/commit/cecf62f4796a681ecc05560f611c919cdb0a5a7e).


----------------------------------------------------------------
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 #30546: [SPARK-33607][SS][WEBUI] Input Rate timeline/histogram aren't rendered if built with Scala 2.13

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


   **[Test build #131986 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/131986/testReport)** for PR 30546 at commit [`cecf62f`](https://github.com/apache/spark/commit/cecf62f4796a681ecc05560f611c919cdb0a5a7e).


----------------------------------------------------------------
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] sarutak commented on pull request #30546: [SPARK-33607][SS][WEBUI] Input Rate timeline/histogram aren't rendered if built with Scala 2.13

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


   cc: @HeartSaVioR 


----------------------------------------------------------------
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 #30546: [SPARK-33607][SS][WEBUI] Input Rate timeline/histogram aren't rendered if built with Scala 2.13

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






----------------------------------------------------------------
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