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/15 04:14:21 UTC

[GitHub] [spark] viirya opened a new pull request #30047: [SPARK-33078][SQL] Add config for json expression optimization

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


   <!--
   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 proposes to add a config for json expression optimization.
   
   ### 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.
   -->
   
   For the new Json expression optimization rules, it is safer if we can disable it using SQL config.
   
   ### 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'.
   -->
   
   Yes, users can disable json expression optimization rule.
   
   ### 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.
   -->
   
   Unit test


----------------------------------------------------------------
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 pull request #30047: [SPARK-33078][SQL] Add config for json expression optimization

Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on pull request #30047:
URL: https://github.com/apache/spark/pull/30047#issuecomment-709548340


   Oh... Sorry, I missed your last comment.. :(


----------------------------------------------------------------
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 #30047: [SPARK-33078][SQL] Add config for json expression optimization

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


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


----------------------------------------------------------------
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 #30047: [SPARK-33078][SQL] Add config for json expression optimization

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



##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/OptimizeJsonExprs.scala
##########
@@ -34,8 +35,10 @@ import org.apache.spark.sql.types.{ArrayType, StructType}
  *      contains all accessed fields in original CreateNamedStruct.
  */
 object OptimizeJsonExprs extends Rule[LogicalPlan] {
+  private def enabledJsonOptimization = SQLConf.get.jsonExpressionOptimization

Review comment:
       Sure.




----------------------------------------------------------------
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 #30047: [SPARK-33078][SQL] Add config for json expression optimization

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






----------------------------------------------------------------
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 #30047: [SPARK-33078][SQL] Add config for json expression optimization

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



##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala
##########
@@ -1458,6 +1458,15 @@ object SQLConf {
       .booleanConf
       .createWithDefault(true)
 
+  val JSON_EXPRESSION_OPTIMIZATION =
+    buildConf("spark.sql.optimizer.jsonExpressionOptimization")

Review comment:
       `Optimization` sounds a bit redundant with `optimizer`. I wonder if we have a better name ..  I am okay with as-is if we don't have a better idea.




----------------------------------------------------------------
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 #30047: [SPARK-33078][SQL] Add config for json expression optimization

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






----------------------------------------------------------------
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] cloud-fan commented on a change in pull request #30047: [SPARK-33078][SQL] Add config for json expression optimization

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #30047:
URL: https://github.com/apache/spark/pull/30047#discussion_r505203912



##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala
##########
@@ -1458,6 +1458,15 @@ object SQLConf {
       .booleanConf
       .createWithDefault(true)
 
+  val JSON_EXPRESSION_OPTIMIZATION =
+    buildConf("spark.sql.optimizer.enableJsonExpressionOptimization")

Review comment:
       hmm, I think users can already disable any optimizer rule via `spark.sql.optimizer.excludedRules`?




----------------------------------------------------------------
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 #30047: [SPARK-33078][SQL] Add config for json expression optimization

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


   **[Test build #129844 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/129844/testReport)** for PR 30047 at commit [`e88cc54`](https://github.com/apache/spark/commit/e88cc54354a4e0ed7ed7a651766cdeb732fc390f).
    * 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] AmplabJenkins commented on pull request #30047: [SPARK-33078][SQL] Add config for json expression optimization

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






----------------------------------------------------------------
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 #30047: [SPARK-33078][SQL] Add config for json expression optimization

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






----------------------------------------------------------------
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 #30047: [SPARK-33078][SQL] Add config for json expression optimization

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






----------------------------------------------------------------
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 #30047: [SPARK-33078][SQL] Add config for json expression optimization

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


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


----------------------------------------------------------------
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 #30047: [SPARK-33078][SQL] Add config for json expression optimization

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


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


----------------------------------------------------------------
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 #30047: [SPARK-33078][SQL] Add config for json expression optimization

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


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


----------------------------------------------------------------
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 #30047: [SPARK-33078][SQL] Add config for json expression optimization

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


   **[Test build #129817 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/129817/testReport)** for PR 30047 at commit [`9d50752`](https://github.com/apache/spark/commit/9d50752e733036bdc124e4666fff1c7096d1d0d6).


----------------------------------------------------------------
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 #30047: [SPARK-33078][SQL] Add config for json expression optimization

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


   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 commented on pull request #30047: [SPARK-33078][SQL] Add config for json expression optimization

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


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


----------------------------------------------------------------
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 #30047: [SPARK-33078][SQL] Add config for json expression optimization

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






----------------------------------------------------------------
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 #30047: [SPARK-33078][SQL] Add config for json expression optimization

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






----------------------------------------------------------------
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 #30047: [SPARK-33078][SQL] Add config for json expression optimization

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


   **[Test build #129804 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/129804/testReport)** for PR 30047 at commit [`9d50752`](https://github.com/apache/spark/commit/9d50752e733036bdc124e4666fff1c7096d1d0d6).


----------------------------------------------------------------
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 #30047: [SPARK-33078][SQL] Add config for json expression optimization

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


   cc @HyukjinKwon @maropu @dongjoon-hyun 


----------------------------------------------------------------
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 #30047: [SPARK-33078][SQL] Add config for json expression optimization

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



##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala
##########
@@ -1458,6 +1458,15 @@ object SQLConf {
       .booleanConf
       .createWithDefault(true)
 
+  val JSON_EXPRESSION_OPTIMIZATION =
+    buildConf("spark.sql.optimizer.jsonExpressionOptimization")

Review comment:
       Also, cc @cloud-fan 




----------------------------------------------------------------
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 #30047: [SPARK-33078][SQL] Add config for json expression optimization

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






----------------------------------------------------------------
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] cloud-fan commented on a change in pull request #30047: [SPARK-33078][SQL] Add config for json expression optimization

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #30047:
URL: https://github.com/apache/spark/pull/30047#discussion_r505215083



##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala
##########
@@ -1458,6 +1458,15 @@ object SQLConf {
       .booleanConf
       .createWithDefault(true)
 
+  val JSON_EXPRESSION_OPTIMIZATION =
+    buildConf("spark.sql.optimizer.enableJsonExpressionOptimization")

Review comment:
       I see, makes sense.




----------------------------------------------------------------
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 #30047: [SPARK-33078][SQL] Add config for json expression optimization

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






----------------------------------------------------------------
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 #30047: [SPARK-33078][SQL] Add config for json expression optimization

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






----------------------------------------------------------------
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 #30047: [SPARK-33078][SQL] Add config for json expression optimization

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


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


----------------------------------------------------------------
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 #30047: [SPARK-33078][SQL] Add config for json expression optimization

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


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


----------------------------------------------------------------
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 #30047: [SPARK-33078][SQL] Add config for json expression optimization

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



##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala
##########
@@ -1458,6 +1458,15 @@ object SQLConf {
       .booleanConf
       .createWithDefault(true)
 
+  val JSON_EXPRESSION_OPTIMIZATION =
+    buildConf("spark.sql.optimizer.enableJsonExpressionOptimization")

Review comment:
       `excludedRules` should work, but I'm thinking to add CSV expression optimization similar to JSON in same rule. If so, a separate config for JSON/CSV expression seems good. If we have two rules for JSON, CSV individually, then `excludedRules` might be enough.




----------------------------------------------------------------
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 #30047: [SPARK-33078][SQL] Add config for json expression optimization

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






----------------------------------------------------------------
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 #30047: [SPARK-33078][SQL] Add config for json expression optimization

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



##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala
##########
@@ -1458,6 +1458,15 @@ object SQLConf {
       .booleanConf
       .createWithDefault(true)
 
+  val JSON_EXPRESSION_OPTIMIZATION =
+    buildConf("spark.sql.optimizer.jsonExpressionOptimization")
+      .doc("Whether to optimize Json expressions in SQL optimizer. It includes pruning " +
+        "unnecessary columns from from_json, simplifing from_json + to_json, to_json + " +
+        "named_struct(from_json.col1, from_json.col2, ....).")
+      .version("3.1.0")
+      .booleanConf
+      .createWithDefault(true)

Review comment:
       Thank you for adding this, @viirya .




----------------------------------------------------------------
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 #30047: [SPARK-33078][SQL] Add config for json expression optimization

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


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


----------------------------------------------------------------
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 #30047: [SPARK-33078][SQL] Add config for json expression optimization

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


   Test FAILed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/129797/
   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] maropu commented on a change in pull request #30047: [SPARK-33078][SQL] Add config for json expression optimization

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



##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/OptimizeJsonExprs.scala
##########
@@ -34,8 +35,10 @@ import org.apache.spark.sql.types.{ArrayType, StructType}
  *      contains all accessed fields in original CreateNamedStruct.
  */
 object OptimizeJsonExprs extends Rule[LogicalPlan] {
+  private def enabledJsonOptimization = SQLConf.get.jsonExpressionOptimization

Review comment:
       We need this variable? Could we inline this in L41?




----------------------------------------------------------------
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 #30047: [SPARK-33078][SQL] Add config for json expression optimization

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



##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala
##########
@@ -1458,6 +1458,15 @@ object SQLConf {
       .booleanConf
       .createWithDefault(true)
 
+  val JSON_EXPRESSION_OPTIMIZATION =
+    buildConf("spark.sql.optimizer.jsonExpressionOptimization")

Review comment:
       Changed. Thanks.




----------------------------------------------------------------
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 #30047: [SPARK-33078][SQL] Add config for json expression optimization

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


   **[Test build #129817 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/129817/testReport)** for PR 30047 at commit [`9d50752`](https://github.com/apache/spark/commit/9d50752e733036bdc124e4666fff1c7096d1d0d6).
    * 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] AmplabJenkins removed a comment on pull request #30047: [SPARK-33078][SQL] Add config for json expression optimization

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






----------------------------------------------------------------
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 #30047: [SPARK-33078][SQL] Add config for json expression optimization

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






----------------------------------------------------------------
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 #30047: [SPARK-33078][SQL] Add config for json expression optimization

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



##########
File path: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/OptimizeJsonExprsSuite.scala
##########
@@ -266,4 +266,16 @@ class OptimizeJsonExprsSuite extends PlanTest with ExpressionEvalHelper {
       checkEvaluation(e1, e2.eval(row), row)
     })
   }
+
+  test("SPARK-33078: disable json optimization") {
+    withSQLConf(SQLConf.JSON_EXPRESSION_OPTIMIZATION.key -> "false") {

Review comment:
       Ok.




----------------------------------------------------------------
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 #30047: [SPARK-33078][SQL] Add config for json expression optimization

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



##########
File path: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/OptimizeJsonExprsSuite.scala
##########
@@ -266,4 +266,16 @@ class OptimizeJsonExprsSuite extends PlanTest with ExpressionEvalHelper {
       checkEvaluation(e1, e2.eval(row), row)
     })
   }
+
+  test("SPARK-33078: disable json optimization") {
+    withSQLConf(SQLConf.JSON_EXPRESSION_OPTIMIZATION.key -> "false") {

Review comment:
       no biggie but should we explicitly enable this configuration in this 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] dongjoon-hyun closed pull request #30047: [SPARK-33078][SQL] Add config for json expression optimization

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


   


----------------------------------------------------------------
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 #30047: [SPARK-33078][SQL] Add config for json expression optimization

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


   **[Test build #129817 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/129817/testReport)** for PR 30047 at commit [`9d50752`](https://github.com/apache/spark/commit/9d50752e733036bdc124e4666fff1c7096d1d0d6).


----------------------------------------------------------------
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 #30047: [SPARK-33078][SQL] Add config for json expression optimization

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


   **[Test build #129844 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/129844/testReport)** for PR 30047 at commit [`e88cc54`](https://github.com/apache/spark/commit/e88cc54354a4e0ed7ed7a651766cdeb732fc390f).


----------------------------------------------------------------
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 #30047: [SPARK-33078][SQL] Add config for json expression optimization

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



##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala
##########
@@ -1458,6 +1458,15 @@ object SQLConf {
       .booleanConf
       .createWithDefault(true)
 
+  val JSON_EXPRESSION_OPTIMIZATION =
+    buildConf("spark.sql.optimizer.jsonExpressionOptimization")

Review comment:
       `jsonExpressionOptimization` -> `enableJsonExpressionOptimization`?




----------------------------------------------------------------
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 #30047: [SPARK-33078][SQL] Add config for json expression optimization

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


   **[Test build #129844 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/129844/testReport)** for PR 30047 at commit [`e88cc54`](https://github.com/apache/spark/commit/e88cc54354a4e0ed7ed7a651766cdeb732fc390f).


----------------------------------------------------------------
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 #30047: [SPARK-33078][SQL] Add config for json expression optimization

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


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


----------------------------------------------------------------
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 #30047: [SPARK-33078][SQL] Add config for json expression optimization

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






----------------------------------------------------------------
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 edited a comment on pull request #30047: [SPARK-33078][SQL] Add config for json expression optimization

Posted by GitBox <gi...@apache.org>.
dongjoon-hyun edited a comment on pull request #30047:
URL: https://github.com/apache/spark/pull/30047#issuecomment-709548340


   Oh... Sorry, I missed your last comment.. :(
   > So I will merge this soon.


----------------------------------------------------------------
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 #30047: [SPARK-33078][SQL] Add config for json expression optimization

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



##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala
##########
@@ -1458,6 +1458,15 @@ object SQLConf {
       .booleanConf
       .createWithDefault(true)
 
+  val JSON_EXPRESSION_OPTIMIZATION =
+    buildConf("spark.sql.optimizer.jsonExpressionOptimization")
+      .doc("Whether to optimize Json expressions in SQL optimizer. It includes pruning " +

Review comment:
       nit: Json -> JSON




----------------------------------------------------------------
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 #30047: [SPARK-33078][SQL] Add config for json expression optimization

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






----------------------------------------------------------------
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 #30047: [SPARK-33078][SQL] Add config for json expression optimization

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


   Thanks for review. Last commit is just to inline config getter. So I will merge this soon.


----------------------------------------------------------------
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 #30047: [SPARK-33078][SQL] Add config for json expression optimization

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






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