You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by eatoncys <gi...@git.apache.org> on 2017/08/22 08:57:48 UTC

[GitHub] spark pull request #19022: [Spark-21807][SQL]The getAliasedConstraints funct...

GitHub user eatoncys opened a pull request:

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

    [Spark-21807][SQL]The getAliasedConstraints function  in LogicalPlan will take a long time when number of expressions is greater than 100

    ## What changes were proposed in this pull request?
    The getAliasedConstraints  fuction in LogicalPlan.scala will clone the expression set when an element added,
    and it will take a long time. This PR add a function to add multiple elements at once to reduce the clone time.
    
    Before modified, the cost of getAliasedConstraints is:
    100 expressions:  41 seconds
    150 expressions:  466 seconds
    
    After modified, the cost of getAliasedConstraints is:
    100 expressions:  1.8 seconds
    150 expressions:  6.5 seconds
    
    The test is like this:
    test("getAliasedConstraints") {
        val expressionNum = 150
        val aggExpression = (1 to expressionNum).map(i => Alias(Count(Literal(1)), s"cnt$i")())
        val aggPlan = Aggregate(Nil, aggExpression, LocalRelation())
    
        val beginTime = System.currentTimeMillis()
        val expressions = aggPlan.validConstraints
        println(s"validConstraints cost: ${System.currentTimeMillis() - beginTime}ms")
        // The size of Aliased expression is n * (n - 1) / 2 + n
        assert( expressions.size === expressionNum * (expressionNum - 1) / 2 + expressionNum)
      }
    
    
    
    (Please fill in changes proposed in this fix)
    
    ## How was this patch tested?
    
    (Please explain how this patch was tested. E.g. unit tests, integration tests, manual tests)
    (If this patch involves UI changes, please attach a screenshot; otherwise, remove this)
    
    Run new added test.
    
    Please review http://spark.apache.org/contributing.html before opening a pull request.


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

    $ git pull https://github.com/eatoncys/spark getAliasedConstraints

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

    https://github.com/apache/spark/pull/19022.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 #19022
    
----
commit 80af01add6c0169c7cad0286afc748d845cd1327
Author: 10129659 <ch...@zte.com.cn>
Date:   2017-08-22T07:47:27Z

    The getAliasedConstraints function will take a long time when expression is greater than 100

----


---
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 #19022: [Spark-21807][SQL]The getAliasedConstraints funct...

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

    https://github.com/apache/spark/pull/19022#discussion_r134684059
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/ExpressionSet.scala ---
    @@ -59,6 +59,12 @@ class ExpressionSet protected(
         }
       }
     
    +  def addMultiExpressions(elems: Set[Expression]): ExpressionSet = {
    --- End diff --
    
    Override `++` instead of `addMultiExpressions`? As it is a `Set`, we better follow Set's semantics.


---
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 issue #19022: [Spark-21807][SQL]The getAliasedConstraints function in ...

Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on the issue:

    https://github.com/apache/spark/pull/19022
  
    add to whitelist


---
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 #19022: [Spark-21807][SQL]The getAliasedConstraints funct...

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

    https://github.com/apache/spark/pull/19022#discussion_r134682541
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/ExpressionSet.scala ---
    @@ -59,6 +59,12 @@ class ExpressionSet protected(
         }
       }
     
    +  def addMultiExpressions(elems: Set[Expression]): ExpressionSet = {
    --- End diff --
    
    `TraversableOnce` instead of `Set`?


---
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 issue #19022: [Spark-21807][SQL]The getAliasedConstraints function in ...

Posted by viirya <gi...@git.apache.org>.
Github user viirya commented on the issue:

    https://github.com/apache/spark/pull/19022
  
    We can edit the PR title and description to show the changes clearly.


---
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 issue #19022: [Spark-21807][SQL]The getAliasedConstraints function in ...

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

    https://github.com/apache/spark/pull/19022
  
    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 issue #19022: [Spark-21807][SQL]Override ++ operation in ExpressionSet...

Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on the issue:

    https://github.com/apache/spark/pull/19022
  
    Thanks! Merging to master. 
    
    You can fix this in your future PRs.


---
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 issue #19022: [Spark-21807][SQL]The getAliasedConstraints function in ...

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

    https://github.com/apache/spark/pull/19022
  
    **[Test build #81039 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/81039/testReport)** for PR 19022 at commit [`57e8a3d`](https://github.com/apache/spark/commit/57e8a3d66d5dc87c7627e0f370fe907233fa1864).


---
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 #19022: [Spark-21807][SQL]Override ++ operation in Expres...

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

    https://github.com/apache/spark/pull/19022#discussion_r134905955
  
    --- Diff: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/ExpressionSetSuite.scala ---
    @@ -210,4 +210,13 @@ class ExpressionSetSuite extends SparkFunSuite {
         assert((initialSet - (aLower + 1)).size == 0)
     
       }
    +
    +  test("add multiple elements to set") {
    +    val initialSet = ExpressionSet(aUpper + 1 :: Nil)
    +    val setToAddWithSameExpression = ExpressionSet(aUpper + 1 :: aUpper + 2 :: Nil)
    +    val setToAdd = ExpressionSet(aUpper + 2 :: aUpper + 3 :: Nil)
    --- End diff --
    
    Yes, I have modified the name to setToAddWithOutSameExpression.


---
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 issue #19022: [Spark-21807][SQL]Override ++ operation in ExpressionSet...

Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on the issue:

    https://github.com/apache/spark/pull/19022
  
    LGTM


---
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 #19022: [Spark-21807][SQL]The getAliasedConstraints funct...

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

    https://github.com/apache/spark/pull/19022#discussion_r134703026
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/ExpressionSet.scala ---
    @@ -59,6 +59,12 @@ class ExpressionSet protected(
         }
       }
     
    +  def addMultiExpressions(elems: Set[Expression]): ExpressionSet = {
    --- End diff --
    
    Ok, Added, thanks.


---
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 #19022: [Spark-21807][SQL]The getAliasedConstraints funct...

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

    https://github.com/apache/spark/pull/19022#discussion_r134684892
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/LogicalPlan.scala ---
    @@ -289,14 +289,15 @@ abstract class UnaryNode extends LogicalPlan {
        * expressions with the corresponding alias
        */
       protected def getAliasedConstraints(projectList: Seq[NamedExpression]): Set[Expression] = {
    -    var allConstraints = child.constraints.asInstanceOf[Set[Expression]]
    +    var allConstraints = child.constraints
         projectList.foreach {
           case a @ Alias(e, _) =>
             // For every alias in `projectList`, replace the reference in constraints by its attribute.
    -        allConstraints ++= allConstraints.map(_ transform {
    +        val replacedElement = allConstraints.map(_ transform {
    --- End diff --
    
    By overriding `++`, we don't need to change those.


---
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 issue #19022: [Spark-21807][SQL]The getAliasedConstraints function in ...

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

    https://github.com/apache/spark/pull/19022
  
    **[Test build #81035 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/81035/testReport)** for PR 19022 at commit [`57e8a3d`](https://github.com/apache/spark/commit/57e8a3d66d5dc87c7627e0f370fe907233fa1864).
     * This patch **fails Scala style 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


[GitHub] spark issue #19022: [Spark-21807][SQL]The getAliasedConstraints function in ...

Posted by HyukjinKwon <gi...@git.apache.org>.
Github user HyukjinKwon commented on the issue:

    https://github.com/apache/spark/pull/19022
  
    ok to test


---
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 issue #19022: [Spark-21807][SQL]The getAliasedConstraints function in ...

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

    https://github.com/apache/spark/pull/19022
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/81035/
    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 #19022: [Spark-21807][SQL]The getAliasedConstraints funct...

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

    https://github.com/apache/spark/pull/19022#discussion_r134685231
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/ExpressionSet.scala ---
    @@ -59,6 +59,12 @@ class ExpressionSet protected(
         }
       }
     
    +  def addMultiExpressions(elems: Set[Expression]): ExpressionSet = {
    --- End diff --
    
    Let's add a related test in `ExpressionSetSuite`.


---
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 issue #19022: [Spark-21807][SQL]Override ++ operation in ExpressionSet...

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

    https://github.com/apache/spark/pull/19022
  
    Merged build finished. Test PASSed.


---
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 issue #19022: [Spark-21807][SQL]The getAliasedConstraints function in ...

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

    https://github.com/apache/spark/pull/19022
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/81039/
    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 #19022: [Spark-21807][SQL]The getAliasedConstraints funct...

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

    https://github.com/apache/spark/pull/19022#discussion_r134760043
  
    --- Diff: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/ExpressionSetSuite.scala ---
    @@ -210,4 +210,13 @@ class ExpressionSetSuite extends SparkFunSuite {
         assert((initialSet - (aLower + 1)).size == 0)
     
       }
    +
    +  test("add multiple elements to set") {
    --- End diff --
    
    Yap, previous `++` works without problem. The override version goes to reduce the time cost. This test is just used to make sure we don't mess up behavior of `++`.


---
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 issue #19022: [Spark-21807][SQL]The getAliasedConstraints function in ...

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

    https://github.com/apache/spark/pull/19022
  
    **[Test build #81039 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/81039/testReport)** for PR 19022 at commit [`57e8a3d`](https://github.com/apache/spark/commit/57e8a3d66d5dc87c7627e0f370fe907233fa1864).
     * This patch **fails Scala style 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


[GitHub] spark pull request #19022: [Spark-21807][SQL]The getAliasedConstraints funct...

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

    https://github.com/apache/spark/pull/19022#discussion_r134761549
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/ExpressionSet.scala ---
    @@ -67,6 +67,12 @@ class ExpressionSet protected(
         newSet
       }
     
    +  override def ++(elems: GenTraversableOnce[Expression]): ExpressionSet = {
    +    val newSet = new ExpressionSet(baseSet.clone(), originals.clone())
    +    elems.foreach(newSet.add)
    +    newSet
    +  }
    +
       override def -(elem: Expression): ExpressionSet = {
    --- End diff --
    
    I guess we don't use `--` frequently or in hot code path. We may add it when we need it.


---
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 issue #19022: [Spark-21807][SQL]Override ++ operation in ExpressionSet...

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

    https://github.com/apache/spark/pull/19022
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/81057/
    Test PASSed.


---
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 issue #19022: [Spark-21807][SQL]The getAliasedConstraints function in ...

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

    https://github.com/apache/spark/pull/19022
  
    Can one of the admins verify this patch?


---
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 #19022: [Spark-21807][SQL]Override ++ operation in Expres...

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

    https://github.com/apache/spark/pull/19022#discussion_r134919964
  
    --- Diff: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/ExpressionSetSuite.scala ---
    @@ -210,4 +210,13 @@ class ExpressionSetSuite extends SparkFunSuite {
         assert((initialSet - (aLower + 1)).size == 0)
     
       }
    +
    +  test("add multiple elements to set") {
    +    val initialSet = ExpressionSet(aUpper + 1 :: Nil)
    +    val setToAddWithSameExpression = ExpressionSet(aUpper + 1 :: aUpper + 2 :: Nil)
    +    val setToAddWithOutSameExpression = ExpressionSet(aUpper + 3 :: aUpper + 4 :: Nil)
    --- End diff --
    
    Nit: `WithOut` -> `Without`



---
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 issue #19022: [Spark-21807][SQL]The getAliasedConstraints function in ...

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

    https://github.com/apache/spark/pull/19022
  
    **[Test build #81057 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/81057/testReport)** for PR 19022 at commit [`0762840`](https://github.com/apache/spark/commit/07628402eeed958c45905974c82b06211f1bc934).


---
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 #19022: [Spark-21807][SQL]The getAliasedConstraints funct...

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

    https://github.com/apache/spark/pull/19022#discussion_r134724999
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/ExpressionSet.scala ---
    @@ -17,7 +17,7 @@
     
     package org.apache.spark.sql.catalyst.expressions
     
    -import scala.collection.mutable
    +import scala.collection.{GenTraversableOnce, mutable}
    --- End diff --
    
    You can do style check by running `dev/scalastyle`.


---
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 #19022: [Spark-21807][SQL]The getAliasedConstraints funct...

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

    https://github.com/apache/spark/pull/19022#discussion_r134724374
  
    --- Diff: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/ExpressionSetSuite.scala ---
    @@ -210,4 +210,13 @@ class ExpressionSetSuite extends SparkFunSuite {
         assert((initialSet - (aLower + 1)).size == 0)
     
       }
    +
    +  test("add multiple elements to set") {
    --- End diff --
    
    This test case doesn't fail without the above code, does it?


---
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 #19022: [Spark-21807][SQL]The getAliasedConstraints funct...

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

    https://github.com/apache/spark/pull/19022#discussion_r134685973
  
    --- Diff: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/plans/LogicalPlanSuite.scala ---
    @@ -89,4 +90,14 @@ class LogicalPlanSuite extends SparkFunSuite {
         assert(TestBinaryRelation(relation, incrementalRelation).isStreaming === true)
         assert(TestBinaryRelation(incrementalRelation, incrementalRelation).isStreaming)
       }
    +
    +  test("getAliasedConstraints") {
    +    val expressionNum = 100
    +    val aggExpression = (1 to expressionNum).map(i => Alias(Count(Literal(1)), s"cnt$i")())
    +    val aggPlan = Aggregate(Nil, aggExpression, LocalRelation())
    +
    +    val expressions = aggPlan.validConstraints
    +    // The size of Aliased expression is n * (n - 1) / 2 + n
    +    assert( expressions.size === expressionNum * (expressionNum - 1) / 2 + expressionNum)
    --- End diff --
    
    Test on the size of `validConstraints` may be fragile. I think we only need to test if the new API of `ExpressionSet` works.


---
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 #19022: [Spark-21807][SQL]The getAliasedConstraints funct...

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

    https://github.com/apache/spark/pull/19022#discussion_r134807546
  
    --- Diff: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/ExpressionSetSuite.scala ---
    @@ -210,4 +210,13 @@ class ExpressionSetSuite extends SparkFunSuite {
         assert((initialSet - (aLower + 1)).size == 0)
     
       }
    +
    +  test("add multiple elements to set") {
    +    val initialSet = ExpressionSet(aUpper + 1 :: Nil)
    +    val setToAddWithSameExpression = ExpressionSet(aUpper + 1 :: aUpper + 2 :: Nil)
    +    val setToAdd = ExpressionSet(aUpper + 2 :: aUpper + 3 :: Nil)
    --- End diff --
    
    Not very sure what you want to test in the second one. Are you want to test the behavior of adding a set of expressions that do not exist in the initial set?
    -> `ExpressionSet(aUpper + 3 :: aUpper + 4 :: Nil)`?



---
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 issue #19022: [Spark-21807][SQL]The getAliasedConstraints function in ...

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

    https://github.com/apache/spark/pull/19022
  
    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 #19022: [Spark-21807][SQL]Override ++ operation in Expres...

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

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


---
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 issue #19022: [Spark-21807][SQL]Override ++ operation in ExpressionSet...

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

    https://github.com/apache/spark/pull/19022
  
    **[Test build #81057 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/81057/testReport)** for PR 19022 at commit [`0762840`](https://github.com/apache/spark/commit/07628402eeed958c45905974c82b06211f1bc934).
     * This patch passes all 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


[GitHub] spark pull request #19022: [Spark-21807][SQL]The getAliasedConstraints funct...

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

    https://github.com/apache/spark/pull/19022#discussion_r134759455
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/ExpressionSet.scala ---
    @@ -17,7 +17,7 @@
     
     package org.apache.spark.sql.catalyst.expressions
     
    -import scala.collection.mutable
    +import scala.collection.{GenTraversableOnce, mutable}
    --- End diff --
    
    @eatoncys This breaks scala style check.


---
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 #19022: [Spark-21807][SQL]The getAliasedConstraints funct...

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

    https://github.com/apache/spark/pull/19022#discussion_r134695982
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/ExpressionSet.scala ---
    @@ -59,6 +59,12 @@ class ExpressionSet protected(
         }
       }
     
    +  def addMultiExpressions(elems: Set[Expression]): ExpressionSet = {
    --- End diff --
    
    Ok, Modified it, thanks.


---
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 issue #19022: [Spark-21807][SQL]The getAliasedConstraints function in ...

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

    https://github.com/apache/spark/pull/19022
  
    **[Test build #81035 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/81035/testReport)** for PR 19022 at commit [`57e8a3d`](https://github.com/apache/spark/commit/57e8a3d66d5dc87c7627e0f370fe907233fa1864).


---
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 issue #19022: [Spark-21807][SQL]The getAliasedConstraints function in ...

Posted by viirya <gi...@git.apache.org>.
Github user viirya commented on the issue:

    https://github.com/apache/spark/pull/19022
  
    cc @gatorsmile @HyukjinKwon May you help to trigger Jenkins tests? Thanks.


---
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 #19022: [Spark-21807][SQL]Override ++ operation in Expres...

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

    https://github.com/apache/spark/pull/19022#discussion_r134905739
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/ExpressionSet.scala ---
    @@ -17,7 +17,7 @@
     
     package org.apache.spark.sql.catalyst.expressions
     
    -import scala.collection.mutable
    +import scala.collection.{GenTraversableOnce, mutable}
    --- End diff --
    
    Ok, modified it, thanks.


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