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/24 00:04:34 UTC

[GitHub] [spark] viirya opened a new pull request #30476: [SPARK-33523][SQL][TEST] Add predicate related benchmark to SubExprEliminationBenchmark

viirya opened a new pull request #30476:
URL: https://github.com/apache/spark/pull/30476


   <!--
   Thanks for sending a pull request!  Here are some tips for you:
     1. If this is your first time, please read our contributor guidelines: https://spark.apache.org/contributing.html
     2. Ensure you have added or run the appropriate tests for your PR: https://spark.apache.org/developer-tools.html
     3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][SPARK-XXXX] Your PR title ...'.
     4. Be sure to keep the PR description updated to reflect all changes.
     5. Please write your PR title to summarize what this PR proposes.
     6. If possible, provide a concise example to reproduce the issue for a faster review.
     7. If you want to add a new configuration, please read the guideline first for naming configurations in
        'core/src/main/scala/org/apache/spark/internal/config/ConfigEntry.scala'.
   -->
   
   ### 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 patch adds predicate related benchmark to `SubExprEliminationBenchmark`.
   
   ### 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.
   -->
   
   We should have a benchmark for subexpression elimination of predicate.
   
   ### 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, dev only.
   
   ### 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.
   -->
   
   Run benchmark locally.


----------------------------------------------------------------
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 #30476: [SPARK-33523][SQL][TEST] Add predicate related benchmark to SubExprEliminationBenchmark

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


   **[Test build #131615 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/131615/testReport)** for PR 30476 at commit [`0ca10ba`](https://github.com/apache/spark/commit/0ca10bac7f5aee72d697202842823b46b7525316).
    * This patch **fails Spark unit 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] AmplabJenkins removed a comment on pull request #30476: [SPARK-33523][SQL][TEST] Add predicate related benchmark to SubExprEliminationBenchmark

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






----------------------------------------------------------------
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] viirya commented on a change in pull request #30476: [SPARK-33523][SQL][TEST] Add predicate related benchmark to SubExprEliminationBenchmark

Posted by GitBox <gi...@apache.org>.
viirya commented on a change in pull request #30476:
URL: https://github.com/apache/spark/pull/30476#discussion_r529098712



##########
File path: sql/core/benchmarks/SubExprEliminationBenchmark-results.txt
##########
@@ -5,11 +5,21 @@ Benchmark for performance of subexpression elimination
 Preparing data for benchmarking ...
 OpenJDK 64-Bit Server VM 1.8.0_265-b01 on Mac OS X 10.15.6
 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
-from_json as subExpr:                      Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
+from_json as subExpr in Project:           Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
 -------------------------------------------------------------------------------------------------------------------------
-subexpressionElimination off, codegen on           26503          27622        1937          0.0   265033362.4       1.0X
-subexpressionElimination off, codegen off          24920          25376         430          0.0   249196978.2       1.1X
-subexpressionElimination on, codegen on             2421           2466          39          0.0    24213606.1      10.9X
-subexpressionElimination on, codegen off            2360           2435          87          0.0    23604320.7      11.2X
+subexpressionElimination off, codegen on           25887          26105         326          0.0   258868246.6       1.0X
+subexpressionElimination off, codegen off          25131          25454         522          0.0   251309329.7       1.0X
+subexpressionElimination on, codegen on             2230           2340         106          0.0    22302959.3      11.6X
+subexpressionElimination on, codegen off            2185           2254          64          0.0    21852694.0      11.8X
+
+Preparing data for benchmarking ...
+OpenJDK 64-Bit Server VM 1.8.0_265-b01 on Mac OS X 10.15.6
+Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
+from_json as subExpr in Filter:            Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
+-------------------------------------------------------------------------------------------------------------------------
+subexpressionElimination off, codegen on           42687          42805         111          0.0   426873372.5       1.0X
+subexpressionElimination off, codegen off          43606          45108        1613          0.0   436055236.3       1.0X
+subexpressionElimination on, codegen on            29761          30563         704          0.0   297614324.4       1.4X

Review comment:
       Seems so, it is subexpression elimination under codegen.




----------------------------------------------------------------
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 #30476: [SPARK-33523][SQL][TEST] Add predicate related benchmark to SubExprEliminationBenchmark

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






----------------------------------------------------------------
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] viirya commented on pull request #30476: [SPARK-33523][SQL][TEST] Add predicate related benchmark to SubExprEliminationBenchmark

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


   retest this please


----------------------------------------------------------------
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 #30476: [SPARK-33523][SQL][TEST] Add predicate related benchmark to SubExprEliminationBenchmark

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


   **[Test build #131618 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/131618/testReport)** for PR 30476 at commit [`930ffe2`](https://github.com/apache/spark/commit/930ffe22c990df8526f1d64756916bc674b18675).


----------------------------------------------------------------
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 #30476: [SPARK-33523][SQL][TEST] Add predicate related benchmark to SubExprEliminationBenchmark

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






----------------------------------------------------------------
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 #30476: [SPARK-33523][SQL][TEST] Add predicate related benchmark to SubExprEliminationBenchmark

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


   **[Test build #131613 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/131613/testReport)** for PR 30476 at commit [`7e3be61`](https://github.com/apache/spark/commit/7e3be6160ef8805646cf06a826adc020bdcd1e1e).


----------------------------------------------------------------
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 #30476: [SPARK-33523][SQL][TEST] Add predicate related benchmark to SubExprEliminationBenchmark

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






----------------------------------------------------------------
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] viirya commented on pull request #30476: [SPARK-33523][SQL][TEST] Add predicate related benchmark to SubExprEliminationBenchmark

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


   Thanks @HyukjinKwon @dongjoon-hyun @maropu 


----------------------------------------------------------------
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 #30476: [SPARK-33523][SQL][TEST] Add predicate related benchmark to SubExprEliminationBenchmark

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






----------------------------------------------------------------
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 #30476: [SPARK-33523][SQL][TEST] Add predicate related benchmark to SubExprEliminationBenchmark

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



##########
File path: sql/core/benchmarks/SubExprEliminationBenchmark-results.txt
##########
@@ -5,11 +5,21 @@ Benchmark for performance of subexpression elimination
 Preparing data for benchmarking ...
 OpenJDK 64-Bit Server VM 1.8.0_265-b01 on Mac OS X 10.15.6
 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
-from_json as subExpr:                      Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
+from_json as subExpr in Project:           Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
 -------------------------------------------------------------------------------------------------------------------------
-subexpressionElimination off, codegen on           26503          27622        1937          0.0   265033362.4       1.0X
-subexpressionElimination off, codegen off          24920          25376         430          0.0   249196978.2       1.1X
-subexpressionElimination on, codegen on             2421           2466          39          0.0    24213606.1      10.9X
-subexpressionElimination on, codegen off            2360           2435          87          0.0    23604320.7      11.2X
+subexpressionElimination off, codegen on           25887          26105         326          0.0   258868246.6       1.0X
+subexpressionElimination off, codegen off          25131          25454         522          0.0   251309329.7       1.0X
+subexpressionElimination on, codegen on             2230           2340         106          0.0    22302959.3      11.6X
+subexpressionElimination on, codegen off            2185           2254          64          0.0    21852694.0      11.8X
+
+Preparing data for benchmarking ...
+OpenJDK 64-Bit Server VM 1.8.0_265-b01 on Mac OS X 10.15.6
+Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
+from_json as subExpr in Filter:            Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
+-------------------------------------------------------------------------------------------------------------------------
+subexpressionElimination off, codegen on           42687          42805         111          0.0   426873372.5       1.0X
+subexpressionElimination off, codegen off          43606          45108        1613          0.0   436055236.3       1.0X
+subexpressionElimination on, codegen on            29761          30563         704          0.0   297614324.4       1.4X

Review comment:
       In this case, do we have only 40% improvement?




----------------------------------------------------------------
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 #30476: [SPARK-33523][SQL][TEST] Add predicate related benchmark to SubExprEliminationBenchmark

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






----------------------------------------------------------------
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 #30476: [SPARK-33523][SQL][TEST] Add predicate related benchmark to SubExprEliminationBenchmark

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






----------------------------------------------------------------
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 #30476: [SPARK-33523][SQL][TEST] Add predicate related benchmark to SubExprEliminationBenchmark

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






----------------------------------------------------------------
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 #30476: [SPARK-33523][SQL][TEST] Add predicate related benchmark to SubExprEliminationBenchmark

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






----------------------------------------------------------------
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 #30476: [SPARK-33523][SQL][TEST] Add predicate related benchmark to SubExprEliminationBenchmark

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






----------------------------------------------------------------
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 #30476: [SPARK-33523][SQL][TEST] Add predicate related benchmark to SubExprEliminationBenchmark

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


   **[Test build #131618 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/131618/testReport)** for PR 30476 at commit [`930ffe2`](https://github.com/apache/spark/commit/930ffe22c990df8526f1d64756916bc674b18675).
    * This patch **fails Spark unit 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 #30476: [SPARK-33523][SQL][TEST] Add predicate related benchmark to SubExprEliminationBenchmark

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


   **[Test build #131613 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/131613/testReport)** for PR 30476 at commit [`7e3be61`](https://github.com/apache/spark/commit/7e3be6160ef8805646cf06a826adc020bdcd1e1e).
    * This patch **fails Spark unit 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] AmplabJenkins commented on pull request #30476: [SPARK-33523][SQL][TEST] Add predicate related benchmark to SubExprEliminationBenchmark

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






----------------------------------------------------------------
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 #30476: [SPARK-33523][SQL][TEST] Add predicate related benchmark to SubExprEliminationBenchmark

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






----------------------------------------------------------------
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] HyukjinKwon commented on a change in pull request #30476: [SPARK-33523][SQL][TEST] Add predicate related benchmark to SubExprEliminationBenchmark

Posted by GitBox <gi...@apache.org>.
HyukjinKwon commented on a change in pull request #30476:
URL: https://github.com/apache/spark/pull/30476#discussion_r529124688



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/execution/SubExprEliminationBenchmark.scala
##########
@@ -108,11 +110,81 @@ object SubExprEliminationBenchmark extends SqlBasedBenchmark {
     }
   }
 
+  def withFilter(rowsNum: Int, numIters: Int): Unit = {
+    val benchmark = new Benchmark("from_json as subExpr in Filter", rowsNum, output = output)
+
+    withTempPath { path =>
+      prepareDataInfo(benchmark)
+      val numCols = 1000
+      val schema = writeWideRow(path.getAbsolutePath, rowsNum, numCols)
+
+      val predicate = (0 until numCols).map { idx =>
+        (from_json('value, schema).getField(s"col$idx") >= Literal(100000)).expr
+      }.asInstanceOf[Seq[Expression]].reduce(Or)
+
+      // We only benchmark subexpression performance under codegen/non-codegen, so disabling
+      // json optimization.
+      benchmark.addCase("subexpressionElimination off, codegen on", numIters) { _ =>
+        withSQLConf(
+          SQLConf.SUBEXPRESSION_ELIMINATION_ENABLED.key -> "false",

Review comment:
       I believe we can do this separately to refactor this whole file.




----------------------------------------------------------------
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] viirya commented on a change in pull request #30476: [SPARK-33523][SQL][TEST] Add predicate related benchmark to SubExprEliminationBenchmark

Posted by GitBox <gi...@apache.org>.
viirya commented on a change in pull request #30476:
URL: https://github.com/apache/spark/pull/30476#discussion_r529128259



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/execution/SubExprEliminationBenchmark.scala
##########
@@ -108,11 +110,81 @@ object SubExprEliminationBenchmark extends SqlBasedBenchmark {
     }
   }
 
+  def withFilter(rowsNum: Int, numIters: Int): Unit = {
+    val benchmark = new Benchmark("from_json as subExpr in Filter", rowsNum, output = output)
+
+    withTempPath { path =>
+      prepareDataInfo(benchmark)
+      val numCols = 1000
+      val schema = writeWideRow(path.getAbsolutePath, rowsNum, numCols)
+
+      val predicate = (0 until numCols).map { idx =>
+        (from_json('value, schema).getField(s"col$idx") >= Literal(100000)).expr
+      }.asInstanceOf[Seq[Expression]].reduce(Or)
+
+      // We only benchmark subexpression performance under codegen/non-codegen, so disabling
+      // json optimization.
+      benchmark.addCase("subexpressionElimination off, codegen on", numIters) { _ =>
+        withSQLConf(
+          SQLConf.SUBEXPRESSION_ELIMINATION_ENABLED.key -> "false",

Review comment:
       Okay, I will refactor it.




----------------------------------------------------------------
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 #30476: [SPARK-33523][SQL][TEST] Add predicate related benchmark to SubExprEliminationBenchmark

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






----------------------------------------------------------------
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] viirya commented on a change in pull request #30476: [SPARK-33523][SQL][TEST] Add predicate related benchmark to SubExprEliminationBenchmark

Posted by GitBox <gi...@apache.org>.
viirya commented on a change in pull request #30476:
URL: https://github.com/apache/spark/pull/30476#discussion_r529098844



##########
File path: sql/core/benchmarks/SubExprEliminationBenchmark-results.txt
##########
@@ -5,11 +5,21 @@ Benchmark for performance of subexpression elimination
 Preparing data for benchmarking ...
 OpenJDK 64-Bit Server VM 1.8.0_265-b01 on Mac OS X 10.15.6
 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
-from_json as subExpr:                      Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
+from_json as subExpr in Project:           Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
 -------------------------------------------------------------------------------------------------------------------------
-subexpressionElimination off, codegen on           26503          27622        1937          0.0   265033362.4       1.0X
-subexpressionElimination off, codegen off          24920          25376         430          0.0   249196978.2       1.1X
-subexpressionElimination on, codegen on             2421           2466          39          0.0    24213606.1      10.9X
-subexpressionElimination on, codegen off            2360           2435          87          0.0    23604320.7      11.2X
+subexpressionElimination off, codegen on           25887          26105         326          0.0   258868246.6       1.0X
+subexpressionElimination off, codegen off          25131          25454         522          0.0   251309329.7       1.0X
+subexpressionElimination on, codegen on             2230           2340         106          0.0    22302959.3      11.6X
+subexpressionElimination on, codegen off            2185           2254          64          0.0    21852694.0      11.8X
+
+Preparing data for benchmarking ...
+OpenJDK 64-Bit Server VM 1.8.0_265-b01 on Mac OS X 10.15.6
+Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
+from_json as subExpr in Filter:            Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
+-------------------------------------------------------------------------------------------------------------------------
+subexpressionElimination off, codegen on           42687          42805         111          0.0   426873372.5       1.0X
+subexpressionElimination off, codegen off          43606          45108        1613          0.0   436055236.3       1.0X
+subexpressionElimination on, codegen on            29761          30563         704          0.0   297614324.4       1.4X

Review comment:
       I will submit subexpression elimination under non-codegen after this.




----------------------------------------------------------------
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] HyukjinKwon commented on a change in pull request #30476: [SPARK-33523][SQL][TEST] Add predicate related benchmark to SubExprEliminationBenchmark

Posted by GitBox <gi...@apache.org>.
HyukjinKwon commented on a change in pull request #30476:
URL: https://github.com/apache/spark/pull/30476#discussion_r529109380



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/execution/SubExprEliminationBenchmark.scala
##########
@@ -108,11 +110,81 @@ object SubExprEliminationBenchmark extends SqlBasedBenchmark {
     }
   }
 
+  def withFilter(rowsNum: Int, numIters: Int): Unit = {
+    val benchmark = new Benchmark("from_json as subExpr in Filter", rowsNum, output = output)
+
+    withTempPath { path =>
+      prepareDataInfo(benchmark)
+      val numCols = 1000
+      val schema = writeWideRow(path.getAbsolutePath, rowsNum, numCols)
+
+      val predicate = (0 until numCols).map { idx =>
+        (from_json('value, schema).getField(s"col$idx") >= Literal(100000)).expr
+      }.asInstanceOf[Seq[Expression]].reduce(Or)
+
+      // We only benchmark subexpression performance under codegen/non-codegen, so disabling
+      // json optimization.
+      benchmark.addCase("subexpressionElimination off, codegen on", numIters) { _ =>
+        withSQLConf(
+          SQLConf.SUBEXPRESSION_ELIMINATION_ENABLED.key -> "false",

Review comment:
       Should we maybe better do this with a loop? e.g.)
   
   ```scala
   Seq(("false", "true", "CODEGEN_ONLY", "false"), ...). foreach {
     case (
          subexpressionElimitationEnabled,
          ...  =>
        benchmark.addCase(s"${SQLConf.key} $subexpressionElimitationEnabled, ...", numIters) { _ =>
           withSQLConf(
             SQLConf.key -> subexpressionElimitationEnabled,
             ...
   ```




----------------------------------------------------------------
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] viirya commented on a change in pull request #30476: [SPARK-33523][SQL][TEST] Add predicate related benchmark to SubExprEliminationBenchmark

Posted by GitBox <gi...@apache.org>.
viirya commented on a change in pull request #30476:
URL: https://github.com/apache/spark/pull/30476#discussion_r529114067



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/execution/SubExprEliminationBenchmark.scala
##########
@@ -108,11 +110,81 @@ object SubExprEliminationBenchmark extends SqlBasedBenchmark {
     }
   }
 
+  def withFilter(rowsNum: Int, numIters: Int): Unit = {
+    val benchmark = new Benchmark("from_json as subExpr in Filter", rowsNum, output = output)
+
+    withTempPath { path =>
+      prepareDataInfo(benchmark)
+      val numCols = 1000
+      val schema = writeWideRow(path.getAbsolutePath, rowsNum, numCols)
+
+      val predicate = (0 until numCols).map { idx =>
+        (from_json('value, schema).getField(s"col$idx") >= Literal(100000)).expr
+      }.asInstanceOf[Seq[Expression]].reduce(Or)
+
+      // We only benchmark subexpression performance under codegen/non-codegen, so disabling
+      // json optimization.
+      benchmark.addCase("subexpressionElimination off, codegen on", numIters) { _ =>
+        withSQLConf(
+          SQLConf.SUBEXPRESSION_ELIMINATION_ENABLED.key -> "false",
+          SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "true",
+          SQLConf.CODEGEN_FACTORY_MODE.key -> "CODEGEN_ONLY",
+          SQLConf.JSON_EXPRESSION_OPTIMIZATION.key -> "false") {
+          val df = spark.read
+            .text(path.getAbsolutePath)
+            .where(Column(predicate))
+          df.collect()

Review comment:
       Okay. I reran the benchmark.




----------------------------------------------------------------
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 #30476: [SPARK-33523][SQL][TEST] Add predicate related benchmark to SubExprEliminationBenchmark

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






----------------------------------------------------------------
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 #30476: [SPARK-33523][SQL][TEST] Add predicate related benchmark to SubExprEliminationBenchmark

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


   **[Test build #131615 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/131615/testReport)** for PR 30476 at commit [`0ca10ba`](https://github.com/apache/spark/commit/0ca10bac7f5aee72d697202842823b46b7525316).


----------------------------------------------------------------
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 #30476: [SPARK-33523][SQL][TEST] Add predicate related benchmark to SubExprEliminationBenchmark

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


   **[Test build #131577 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/131577/testReport)** for PR 30476 at commit [`7e3be61`](https://github.com/apache/spark/commit/7e3be6160ef8805646cf06a826adc020bdcd1e1e).


----------------------------------------------------------------
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 #30476: [SPARK-33523][SQL][TEST] Add predicate related benchmark to SubExprEliminationBenchmark

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






----------------------------------------------------------------
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 #30476: [SPARK-33523][SQL][TEST] Add predicate related benchmark to SubExprEliminationBenchmark

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


   **[Test build #131577 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/131577/testReport)** for PR 30476 at commit [`7e3be61`](https://github.com/apache/spark/commit/7e3be6160ef8805646cf06a826adc020bdcd1e1e).
    * This patch **fails Spark unit 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 removed a comment on pull request #30476: [SPARK-33523][SQL][TEST] Add predicate related benchmark to SubExprEliminationBenchmark

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


   **[Test build #131577 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/131577/testReport)** for PR 30476 at commit [`7e3be61`](https://github.com/apache/spark/commit/7e3be6160ef8805646cf06a826adc020bdcd1e1e).


----------------------------------------------------------------
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] HyukjinKwon commented on a change in pull request #30476: [SPARK-33523][SQL][TEST] Add predicate related benchmark to SubExprEliminationBenchmark

Posted by GitBox <gi...@apache.org>.
HyukjinKwon commented on a change in pull request #30476:
URL: https://github.com/apache/spark/pull/30476#discussion_r529105230



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/execution/SubExprEliminationBenchmark.scala
##########
@@ -108,11 +110,81 @@ object SubExprEliminationBenchmark extends SqlBasedBenchmark {
     }
   }
 
+  def withFilter(rowsNum: Int, numIters: Int): Unit = {
+    val benchmark = new Benchmark("from_json as subExpr in Filter", rowsNum, output = output)
+
+    withTempPath { path =>
+      prepareDataInfo(benchmark)
+      val numCols = 1000
+      val schema = writeWideRow(path.getAbsolutePath, rowsNum, numCols)
+
+      val predicate = (0 until numCols).map { idx =>
+        (from_json('value, schema).getField(s"col$idx") >= Literal(100000)).expr
+      }.asInstanceOf[Seq[Expression]].reduce(Or)
+
+      // We only benchmark subexpression performance under codegen/non-codegen, so disabling
+      // json optimization.
+      benchmark.addCase("subexpressionElimination off, codegen on", numIters) { _ =>
+        withSQLConf(
+          SQLConf.SUBEXPRESSION_ELIMINATION_ENABLED.key -> "false",
+          SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "true",
+          SQLConf.CODEGEN_FACTORY_MODE.key -> "CODEGEN_ONLY",
+          SQLConf.JSON_EXPRESSION_OPTIMIZATION.key -> "false") {
+          val df = spark.read
+            .text(path.getAbsolutePath)
+            .where(Column(predicate))
+          df.collect()

Review comment:
       Can we use `write.format("noop").save()`?




----------------------------------------------------------------
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] HyukjinKwon commented on pull request #30476: [SPARK-33523][SQL][TEST] Add predicate related benchmark to SubExprEliminationBenchmark

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


   GA passed. 
   Merged to master.


----------------------------------------------------------------
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 #30476: [SPARK-33523][SQL][TEST] Add predicate related benchmark to SubExprEliminationBenchmark

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






----------------------------------------------------------------
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] HyukjinKwon closed pull request #30476: [SPARK-33523][SQL][TEST] Add predicate related benchmark to SubExprEliminationBenchmark

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


   


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