You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by sameeragarwal <gi...@git.apache.org> on 2016/04/20 10:13:36 UTC

[GitHub] spark pull request: [SPARK-14748][SQL] BoundReference should not s...

GitHub user sameeragarwal opened a pull request:

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

    [SPARK-14748][SQL] BoundReference should not set ExprCode.code to empty string

    ## What changes were proposed in this pull request?
    
    While generating code for `BoundReference`, for variables that have already been evaluated we should not set `ExprCode.code` to empty string and should just return the original `ExprCode`.
    
    ## How was this patch tested?
    
    Existing test should catch any issues. In particular, we should fix the generated code for any operator should it now start failing.

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

    $ git pull https://github.com/sameeragarwal/spark exprcode

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

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

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

    This closes #12523
    
----
commit cb2889708f85d839e687ff6562409f34fd00baef
Author: Sameer Agarwal <sa...@databricks.com>
Date:   2016-04-20T08:03:56Z

    BoundReference should not set ExprCode.code to empty string

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] spark pull request: [SPARK-14748][SQL] BoundReference should not s...

Posted by sameeragarwal <gi...@git.apache.org>.
Github user sameeragarwal commented on the pull request:

    https://github.com/apache/spark/pull/12523#issuecomment-213123144
  
    It seems like we're mutating `ExprCode` at a bunch of additional places (`evaluateVariables` and `evaluateRequiredVariables`) and it seems like that's due to the limitation of how `currentVars` currently work. I'll go ahead and close this for now but we should revisit this in future.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] spark pull request: [SPARK-14748][SQL] BoundReference should not s...

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

    https://github.com/apache/spark/pull/12523#issuecomment-212348039
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/56343/
    Test FAILed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] spark pull request: [SPARK-14748][SQL] BoundReference should not s...

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

    https://github.com/apache/spark/pull/12523#issuecomment-212348031
  
    Merged build finished. Test FAILed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] spark pull request: [SPARK-14748][SQL] BoundReference should not s...

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

    https://github.com/apache/spark/pull/12523#issuecomment-212318727
  
    **[Test build #56343 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/56343/consoleFull)** for PR 12523 at commit [`cb28897`](https://github.com/apache/spark/commit/cb2889708f85d839e687ff6562409f34fd00baef).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] spark pull request: [SPARK-14748][SQL] BoundReference should not s...

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

    https://github.com/apache/spark/pull/12523#discussion_r60515689
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/BoundAttribute.scala ---
    @@ -62,12 +62,7 @@ case class BoundReference(ordinal: Int, dataType: DataType, nullable: Boolean)
         val javaType = ctx.javaType(dataType)
         val value = ctx.getValue(ctx.INPUT_ROW, dataType, ordinal.toString)
         if (ctx.currentVars != null && ctx.currentVars(ordinal) != null) {
    -      val oev = ctx.currentVars(ordinal)
    -      ev.isNull = oev.isNull
    -      ev.value = oev.value
    -      val code = oev.code
    -      oev.code = ""
    -      ev.copy(code = code)
    +      ctx.currentVars(ordinal)
    --- End diff --
    
    This is not logically equivalent, the previous one mutate the `ctx.currentVars`, but this one doesn't. cc @davies 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] spark pull request: [SPARK-14748][SQL] BoundReference should not s...

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

    https://github.com/apache/spark/pull/12523#discussion_r60535152
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/BoundAttribute.scala ---
    @@ -62,12 +62,7 @@ case class BoundReference(ordinal: Int, dataType: DataType, nullable: Boolean)
         val javaType = ctx.javaType(dataType)
         val value = ctx.getValue(ctx.INPUT_ROW, dataType, ordinal.toString)
         if (ctx.currentVars != null && ctx.currentVars(ordinal) != null) {
    -      val oev = ctx.currentVars(ordinal)
    -      ev.isNull = oev.isNull
    -      ev.value = oev.value
    -      val code = oev.code
    -      oev.code = ""
    -      ev.copy(code = code)
    +      ctx.currentVars(ordinal)
    --- End diff --
    
    That mutation is not necessary


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] spark pull request: [SPARK-14748][SQL] BoundReference should not s...

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

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


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] spark pull request: [SPARK-14748][SQL] BoundReference should not s...

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

    https://github.com/apache/spark/pull/12523#issuecomment-212347551
  
    **[Test build #56343 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/56343/consoleFull)** for PR 12523 at commit [`cb28897`](https://github.com/apache/spark/commit/cb2889708f85d839e687ff6562409f34fd00baef).
     * This patch **fails Spark unit tests**.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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