You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by davies <gi...@git.apache.org> on 2015/10/09 23:13:27 UTC

[GitHub] spark pull request: [SPARK-11009] [SQL] fix wrong result of Window...

GitHub user davies opened a pull request:

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

    [SPARK-11009] [SQL] fix wrong result of Window function in cluster mode

    Currently, All windows function will generate wrong result in cluster sometimes.
    
    The root cause is that AttributeReference is called in executor, then id of it may not be unique than others created in driver.

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

    $ git pull https://github.com/davies/spark wrong_window

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

    https://github.com/apache/spark/pull/9050.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 #9050
    
----
commit 35b7b229b245d26ed8a72c2dd3701e2675ec27ea
Author: Davies Liu <da...@databricks.com>
Date:   2015-10-09T21:04:41Z

    fix wrong result of Window function in cluster mode

----


---
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-11009] [SQL] fix wrong result of Window...

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

    https://github.com/apache/spark/pull/9050#issuecomment-146988025
  
     Merged build triggered.


---
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-11009] [SQL] fix wrong result of Window...

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

    https://github.com/apache/spark/pull/9050#discussion_r41806612
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/execution/Window.scala ---
    @@ -205,14 +204,15 @@ case class Window(
        */
       private[this] def createResultProjection(
           expressions: Seq[Expression]): MutableProjection = {
    -    val unboundToAttr = expressions.map {
    -      e => (e, AttributeReference("windowResult", e.dataType, e.nullable)())
    +    val references = expressions.zipWithIndex.map{ case (e, i) =>
    +      // Results of window expressions will be on the right side of child's output
    +      BoundReference(child.output.size + i, e.dataType, e.nullable)
         }
    -    val unboundToAttrMap = unboundToAttr.toMap
    -    val patchedWindowExpression = windowExpression.map(_.transform(unboundToAttrMap))
    +    val unboundToRefMap = expressions.zip(references).toMap
    +    val patchedWindowExpression = windowExpression.map(_.transform(unboundToRefMap))
         newMutableProjection(
           projectList ++ patchedWindowExpression,
    -      child.output ++ unboundToAttr.map(_._2))()
    +      child.output)()
    --- End diff --
    
    Is it true that the input row of this projection has more elements than `child.output`? Maybe it is not very easy to understand this subtle change?


---
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-11009] [SQL] fix wrong result of Window...

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

    https://github.com/apache/spark/pull/9050#issuecomment-147601899
  
    Merged build started.


---
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-11009] [SQL] fix wrong result of Window...

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

    https://github.com/apache/spark/pull/9050#issuecomment-147534312
  
      [Test build #43590 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/43590/consoleFull) for   PR 9050 at commit [`2d55882`](https://github.com/apache/spark/commit/2d55882530aaa1c852e8294b8cb11af158f37481).


---
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-11009] [SQL] fix wrong result of Window...

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

    https://github.com/apache/spark/pull/9050#discussion_r41826342
  
    --- Diff: sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveSparkSubmitSuite.scala ---
    @@ -320,3 +331,36 @@ object SPARK_9757 extends QueryTest {
         }
       }
     }
    +
    +object SPARK_11009 extends QueryTest {
    +  import org.apache.spark.sql.functions._
    +
    +  protected var sqlContext: SQLContext = _
    +
    +  def main(args: Array[String]): Unit = {
    +    Utils.configTestLog4j("INFO")
    +
    +    val sparkContext = new SparkContext(
    +      new SparkConf()
    +        .set("spark.ui.enabled", "false")
    +        .set("spark.sql.shuffle.partitions", "3"))
    +
    +    val hiveContext = new TestHiveContext(sparkContext)
    +    sqlContext = hiveContext
    +
    +    try {
    +      val df = sqlContext.range(1<<20)
    +      val df2 = df.select((df("id") % 1000).alias("A"), (df("id") / 1000).alias("B"))
    +      val ws = Window.partitionBy(df2("A")).orderBy(df2("B"))
    +      val df3 =
    +        df2
    +          .select(df2("A"), df2("B"), rowNumber().over(ws).alias("rn"))
    +          .filter("rn < 0")
    +      if (df3.count() == 0) {
    --- End diff --
    
    ah, sorry. Actually, can we do `df3.rdd.count()` to make sure we do materialize all results? 


---
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-11009] [SQL] fix wrong result of Window...

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

    https://github.com/apache/spark/pull/9050#issuecomment-146988047
  
    Merged build started.


---
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-11009] [SQL] fix wrong result of Window...

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

    https://github.com/apache/spark/pull/9050#discussion_r41891559
  
    --- Diff: sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveSparkSubmitSuite.scala ---
    @@ -320,3 +331,31 @@ object SPARK_9757 extends QueryTest {
         }
       }
     }
    +
    +object SPARK_11009 extends QueryTest {
    +  import org.apache.spark.sql.functions._
    +
    +  protected var sqlContext: SQLContext = _
    +
    +  def main(args: Array[String]): Unit = {
    +    Utils.configTestLog4j("INFO")
    +
    +    val sparkContext = new SparkContext(
    +      new SparkConf()
    +        .set("spark.ui.enabled", "false")
    +        .set("spark.sql.shuffle.partitions", "100"))
    +
    +    val hiveContext = new TestHiveContext(sparkContext)
    +    sqlContext = hiveContext
    +
    +    try {
    +      val df = sqlContext.range(1 << 20)
    +      val df2 = df.select((df("id") % 1000).alias("A"), (df("id") / 1000).alias("B"))
    +      val ws = Window.partitionBy(df2("A")).orderBy(df2("B"))
    +      val df3 = df2.select(df2("A"), df2("B"), rowNumber().over(ws).alias("rn")).filter("rn < 0")
    +      assert(df3.rdd.count() === 0)
    --- End diff --
    
    Will fix it while I merging 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: [SPARK-11009] [SQL] fix wrong result of Window...

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

    https://github.com/apache/spark/pull/9050#issuecomment-147552568
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/43590/
    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 pull request: [SPARK-11009] [SQL] fix wrong result of Window...

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

    https://github.com/apache/spark/pull/9050#issuecomment-146995569
  
      [Test build #1869 has finished](https://amplab.cs.berkeley.edu/jenkins/job/NewSparkPullRequestBuilder/1869/console) for   PR 9050 at commit [`35b7b22`](https://github.com/apache/spark/commit/35b7b229b245d26ed8a72c2dd3701e2675ec27ea).
     * This patch **fails MiMa tests**.
     * This patch merges cleanly.
     * This patch adds the following public classes _(experimental)_:
      * `class ChildProcAppHandle implements SparkAppHandle `
      * `abstract class LauncherConnection implements Closeable, Runnable `
      * `final class LauncherProtocol `
      * `  static class Message implements Serializable `
      * `  static class Hello extends Message `
      * `  static class SetAppId extends Message `
      * `  static class SetState extends Message `
      * `  static class Stop extends Message `
      * `class LauncherServer implements Closeable `
      * `class NamedThreadFactory implements ThreadFactory `
      * `class OutputRedirector `
      * `public final class UnsafeRow extends MutableRow implements Externalizable, KryoSerializable `
      * `  /** Run a function within Hive state (SessionState, HiveConf, Hive client and class loader) */`



---
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-11009] [SQL] fix wrong result of Window...

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

    https://github.com/apache/spark/pull/9050#issuecomment-146997789
  
      [Test build #1870 has started](https://amplab.cs.berkeley.edu/jenkins/job/NewSparkPullRequestBuilder/1870/consoleFull) for   PR 9050 at commit [`35b7b22`](https://github.com/apache/spark/commit/35b7b229b245d26ed8a72c2dd3701e2675ec27ea).


---
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-11009] [SQL] fix wrong result of Window...

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

    https://github.com/apache/spark/pull/9050#issuecomment-147023120
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/43505/
    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 pull request: [SPARK-11009] [SQL] fix wrong result of Window...

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

    https://github.com/apache/spark/pull/9050#issuecomment-147116624
  
    @hvanhovell Yes, we will backport it to 1.5 branch. So it will be fixed in 1.5.2.
    
    Let me explain the cause. Every attribute reference has an `exprId`. If you do not explicitly assign this id (probably most of cases) when you create an attribute reference, you will get a unique id (see https://github.com/apache/spark/blob/master/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/namedExpressions.scala#L27). However, if we create attribute references in both driver and executors, the uniqueness of the exprId will not be held anymore. So, we can see two attribute references representing two different columns having the same ids. Because our attribute binding work relies on the uniqueness of the exprId, once this property does not hold anymore, we will bind to wrong columns when evaluating expressions and generate wrong results.


---
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-11009] [SQL] fix wrong result of Window...

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

    https://github.com/apache/spark/pull/9050#issuecomment-147552459
  
      [Test build #43590 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/43590/console) for   PR 9050 at commit [`2d55882`](https://github.com/apache/spark/commit/2d55882530aaa1c852e8294b8cb11af158f37481).
     * 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: [SPARK-11009] [SQL] fix wrong result of Window...

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

    https://github.com/apache/spark/pull/9050#issuecomment-147630727
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/43624/
    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-11009] [SQL] fix wrong result of Window...

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

    https://github.com/apache/spark/pull/9050#issuecomment-147533670
  
     Merged build triggered.


---
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-11009] [SQL] fix wrong result of Window...

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

    https://github.com/apache/spark/pull/9050#issuecomment-147624305
  
    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-11009] [SQL] fix wrong result of Window...

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

    https://github.com/apache/spark/pull/9050#issuecomment-146992499
  
      [Test build #1869 has started](https://amplab.cs.berkeley.edu/jenkins/job/NewSparkPullRequestBuilder/1869/consoleFull) for   PR 9050 at commit [`35b7b22`](https://github.com/apache/spark/commit/35b7b229b245d26ed8a72c2dd3701e2675ec27ea).


---
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-11009] [SQL] fix wrong result of Window...

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

    https://github.com/apache/spark/pull/9050#issuecomment-146990510
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/43492/
    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-11009] [SQL] fix wrong result of Window...

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

    https://github.com/apache/spark/pull/9050#issuecomment-147532949
  
    @yhuai @hvanhovell I had changed to use BoundReference instead of Attribute


---
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-11009] [SQL] fix wrong result of Window...

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

    https://github.com/apache/spark/pull/9050#issuecomment-147600154
  
      [Test build #43618 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/43618/consoleFull) for   PR 9050 at commit [`153140a`](https://github.com/apache/spark/commit/153140a0faa545e7a44ad8009669b0364a175ed7).


---
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-11009] [SQL] fix wrong result of Window...

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

    https://github.com/apache/spark/pull/9050#issuecomment-147620479
  
     Merged build triggered.


---
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-11009] [SQL] fix wrong result of Window...

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

    https://github.com/apache/spark/pull/9050#issuecomment-147623169
  
      [Test build #43624 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/43624/consoleFull) for   PR 9050 at commit [`3aec389`](https://github.com/apache/spark/commit/3aec389d82363975fc4e8a17e8bf69474a70c988).


---
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-11009] [SQL] fix wrong result of Window...

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

    https://github.com/apache/spark/pull/9050#discussion_r41890867
  
    --- Diff: sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveSparkSubmitSuite.scala ---
    @@ -320,3 +331,31 @@ object SPARK_9757 extends QueryTest {
         }
       }
     }
    +
    +object SPARK_11009 extends QueryTest {
    +  import org.apache.spark.sql.functions._
    +
    +  protected var sqlContext: SQLContext = _
    +
    +  def main(args: Array[String]): Unit = {
    +    Utils.configTestLog4j("INFO")
    +
    +    val sparkContext = new SparkContext(
    +      new SparkConf()
    +        .set("spark.ui.enabled", "false")
    +        .set("spark.sql.shuffle.partitions", "100"))
    +
    +    val hiveContext = new TestHiveContext(sparkContext)
    +    sqlContext = hiveContext
    +
    +    try {
    +      val df = sqlContext.range(1 << 20)
    +      val df2 = df.select((df("id") % 1000).alias("A"), (df("id") / 1000).alias("B"))
    +      val ws = Window.partitionBy(df2("A")).orderBy(df2("B"))
    +      val df3 = df2.select(df2("A"), df2("B"), rowNumber().over(ws).alias("rn")).filter("rn < 0")
    +      assert(df3.rdd.count() === 0)
    --- End diff --
    
    We have to throw an exception at here. Otherwise, even this assertion fails, the test will pass (because we are running an application at here).


---
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-11009] [SQL] fix wrong result of Window...

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

    https://github.com/apache/spark/pull/9050#issuecomment-147639405
  
      [Test build #1887 has started](https://amplab.cs.berkeley.edu/jenkins/job/NewSparkPullRequestBuilder/1887/consoleFull) for   PR 9050 at commit [`3aec389`](https://github.com/apache/spark/commit/3aec389d82363975fc4e8a17e8bf69474a70c988).


---
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-11009] [SQL] fix wrong result of Window...

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

    https://github.com/apache/spark/pull/9050#issuecomment-147602563
  
      [Test build #43621 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/43621/consoleFull) for   PR 9050 at commit [`89c1401`](https://github.com/apache/spark/commit/89c140104ff931f4d5c154f754d9f43891cd600f).


---
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-11009] [SQL] fix wrong result of Window...

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

    https://github.com/apache/spark/pull/9050#issuecomment-147013212
  
      [Test build #1870 has finished](https://amplab.cs.berkeley.edu/jenkins/job/NewSparkPullRequestBuilder/1870/console) for   PR 9050 at commit [`35b7b22`](https://github.com/apache/spark/commit/35b7b229b245d26ed8a72c2dd3701e2675ec27ea).
     * This patch **passes all tests**.
     * This patch merges cleanly.
     * This patch adds the following public classes _(experimental)_:
      * `class ChildProcAppHandle implements SparkAppHandle `
      * `abstract class LauncherConnection implements Closeable, Runnable `
      * `final class LauncherProtocol `
      * `  static class Message implements Serializable `
      * `  static class Hello extends Message `
      * `  static class SetAppId extends Message `
      * `  static class SetState extends Message `
      * `  static class Stop extends Message `
      * `class LauncherServer implements Closeable `
      * `class NamedThreadFactory implements ThreadFactory `
      * `class OutputRedirector `



---
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-11009] [SQL] fix wrong result of Window...

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

    https://github.com/apache/spark/pull/9050#issuecomment-147023119
  
    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 pull request: [SPARK-11009] [SQL] fix wrong result of Window...

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

    https://github.com/apache/spark/pull/9050#issuecomment-147630724
  
    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-11009] [SQL] fix wrong result of Window...

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

    https://github.com/apache/spark/pull/9050#issuecomment-147015097
  
    Merged build started.


---
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-11009] [SQL] fix wrong result of Window...

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

    https://github.com/apache/spark/pull/9050#issuecomment-146990509
  
    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-11009] [SQL] fix wrong result of Window...

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

    https://github.com/apache/spark/pull/9050#issuecomment-147023090
  
      [Test build #43505 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/43505/console) for   PR 9050 at commit [`39b99b8`](https://github.com/apache/spark/commit/39b99b819a5219cdb9ea4fae8e58ed9582cc10a6).
     * 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: [SPARK-11009] [SQL] fix wrong result of Window...

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

    https://github.com/apache/spark/pull/9050#issuecomment-147601820
  
      [Test build #43618 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/43618/console) for   PR 9050 at commit [`153140a`](https://github.com/apache/spark/commit/153140a0faa545e7a44ad8009669b0364a175ed7).
     * This patch **fails MiMa 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: [SPARK-11009] [SQL] fix wrong result of Window...

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

    https://github.com/apache/spark/pull/9050#issuecomment-147015864
  
      [Test build #43505 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/43505/consoleFull) for   PR 9050 at commit [`39b99b8`](https://github.com/apache/spark/commit/39b99b819a5219cdb9ea4fae8e58ed9582cc10a6).


---
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-11009] [SQL] fix wrong result of Window...

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

    https://github.com/apache/spark/pull/9050#issuecomment-147630677
  
      [Test build #43624 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/43624/console) for   PR 9050 at commit [`3aec389`](https://github.com/apache/spark/commit/3aec389d82363975fc4e8a17e8bf69474a70c988).
     * 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


[GitHub] spark pull request: [SPARK-11009] [SQL] fix wrong result of Window...

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

    https://github.com/apache/spark/pull/9050#issuecomment-147624308
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/43621/
    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-11009] [SQL] fix wrong result of Window...

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

    https://github.com/apache/spark/pull/9050#discussion_r41828330
  
    --- Diff: sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveSparkSubmitSuite.scala ---
    @@ -320,3 +331,36 @@ object SPARK_9757 extends QueryTest {
         }
       }
     }
    +
    +object SPARK_11009 extends QueryTest {
    +  import org.apache.spark.sql.functions._
    +
    +  protected var sqlContext: SQLContext = _
    +
    +  def main(args: Array[String]): Unit = {
    +    Utils.configTestLog4j("INFO")
    +
    +    val sparkContext = new SparkContext(
    +      new SparkConf()
    +        .set("spark.ui.enabled", "false")
    +        .set("spark.sql.shuffle.partitions", "3"))
    +
    +    val hiveContext = new TestHiveContext(sparkContext)
    +    sqlContext = hiveContext
    +
    +    try {
    +      val df = sqlContext.range(1<<20)
    +      val df2 = df.select((df("id") % 1000).alias("A"), (df("id") / 1000).alias("B"))
    +      val ws = Window.partitionBy(df2("A")).orderBy(df2("B"))
    +      val df3 =
    +        df2
    +          .select(df2("A"), df2("B"), rowNumber().over(ws).alias("rn"))
    +          .filter("rn < 0")
    +      if (df3.rdd.count() == 0) {
    --- End diff --
    
    Sorry. This condition should be !=. Can we run this action a few more times to make it have a higher chance of throwing the exception when it is broken (say 10 times)? It should not make this test much more expensive because the most expensive part is creating the HiveContext.
    
    {code}
    (1 to 10).foreach { i =>
      val count = df3.rdd.count()
      if (count != 0) {
        throw new Exception(s"df3 should have 0 row. However $count rows got returned.")
      }
    }
    {code}


---
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-11009] [SQL] fix wrong result of Window...

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

    https://github.com/apache/spark/pull/9050#issuecomment-147601877
  
     Merged build triggered.


---
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-11009] [SQL] fix wrong result of Window...

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

    https://github.com/apache/spark/pull/9050#issuecomment-147015091
  
     Merged build triggered.


---
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-11009] [SQL] fix wrong result of Window...

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

    https://github.com/apache/spark/pull/9050#issuecomment-147599285
  
    @yhuai Thanks, pulled in.


---
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-11009] [SQL] fix wrong result of Window...

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

    https://github.com/apache/spark/pull/9050#issuecomment-147601840
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/43618/
    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-11009] [SQL] fix wrong result of Window...

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

    https://github.com/apache/spark/pull/9050#issuecomment-147561321
  
    @davies I created a test based on the case you put in the description (https://github.com/yhuai/spark/commit/bc566fa0d5e56d5c10c6ad7245336d9fb1bf101c). Seems it indeed fails. How about we add it in the PR?


---
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-11009] [SQL] fix wrong result of Window...

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

    https://github.com/apache/spark/pull/9050#discussion_r41831011
  
    --- Diff: sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveSparkSubmitSuite.scala ---
    @@ -320,3 +331,36 @@ object SPARK_9757 extends QueryTest {
         }
       }
     }
    +
    +object SPARK_11009 extends QueryTest {
    +  import org.apache.spark.sql.functions._
    +
    +  protected var sqlContext: SQLContext = _
    +
    +  def main(args: Array[String]): Unit = {
    +    Utils.configTestLog4j("INFO")
    +
    +    val sparkContext = new SparkContext(
    +      new SparkConf()
    +        .set("spark.ui.enabled", "false")
    +        .set("spark.sql.shuffle.partitions", "3"))
    +
    +    val hiveContext = new TestHiveContext(sparkContext)
    +    sqlContext = hiveContext
    +
    +    try {
    +      val df = sqlContext.range(1<<20)
    +      val df2 = df.select((df("id") % 1000).alias("A"), (df("id") / 1000).alias("B"))
    +      val ws = Window.partitionBy(df2("A")).orderBy(df2("B"))
    +      val df3 =
    +        df2
    +          .select(df2("A"), df2("B"), rowNumber().over(ws).alias("rn"))
    +          .filter("rn < 0")
    +      if (df3.rdd.count() == 0) {
    --- End diff --
    
    If failure should only happen for the first time (having the same id both in driver and in executor). We can increase the number of partitions to increase the change to fail.


---
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-11009] [SQL] fix wrong result of Window...

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

    https://github.com/apache/spark/pull/9050#issuecomment-147599445
  
    Merged build started.


---
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-11009] [SQL] fix wrong result of Window...

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

    https://github.com/apache/spark/pull/9050#issuecomment-147077121
  
    Good catch! Shouldn't we also backport this one into the 1.5 branch?
    
    @davies @yhuai could one of you guys explain to me why/where this is causing problems? I have been looking at the Window.scala code and it doesn't seem problematic there, so I assume that it causes issues further down the line?


---
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-11009] [SQL] fix wrong result of Window...

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

    https://github.com/apache/spark/pull/9050#issuecomment-146998217
  
    We have another place to create the attribute references (https://github.com/davies/spark/blob/wrong_window/sql/core/src/main/scala/org/apache/spark/sql/execution/Window.scala#L149). Also change this?


---
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-11009] [SQL] fix wrong result of Window...

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

    https://github.com/apache/spark/pull/9050#issuecomment-147529098
  
    @yhuai `HiveSparkSubmitSuite` could be an option to have a regression test, but it's very slow, and regression test will be tricky (also depends on number of partitions), I'd not have a regression for now.


---
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-11009] [SQL] fix wrong result of Window...

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

    https://github.com/apache/spark/pull/9050#issuecomment-147599434
  
     Merged build triggered.


---
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-11009] [SQL] fix wrong result of Window...

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

    https://github.com/apache/spark/pull/9050#issuecomment-147667552
  
      [Test build #1887 has finished](https://amplab.cs.berkeley.edu/jenkins/job/NewSparkPullRequestBuilder/1887/console) for   PR 9050 at commit [`3aec389`](https://github.com/apache/spark/commit/3aec389d82363975fc4e8a17e8bf69474a70c988).
     * 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: [SPARK-11009] [SQL] fix wrong result of Window...

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

    https://github.com/apache/spark/pull/9050#issuecomment-147533733
  
    Merged build started.


---
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-11009] [SQL] fix wrong result of Window...

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

    https://github.com/apache/spark/pull/9050#issuecomment-147036791
  
    Thank you for fixing it! How about we add a test in `HiveSparkSubmitSuite`? I guess we can reproduce the problem with `local-cluster`.


---
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-11009] [SQL] fix wrong result of Window...

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

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


---
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-11009] [SQL] fix wrong result of Window...

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

    https://github.com/apache/spark/pull/9050#discussion_r41808264
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/execution/Window.scala ---
    @@ -205,14 +204,15 @@ case class Window(
        */
       private[this] def createResultProjection(
           expressions: Seq[Expression]): MutableProjection = {
    -    val unboundToAttr = expressions.map {
    -      e => (e, AttributeReference("windowResult", e.dataType, e.nullable)())
    +    val references = expressions.zipWithIndex.map{ case (e, i) =>
    +      // Results of window expressions will be on the right side of child's output
    +      BoundReference(child.output.size + i, e.dataType, e.nullable)
         }
    -    val unboundToAttrMap = unboundToAttr.toMap
    -    val patchedWindowExpression = windowExpression.map(_.transform(unboundToAttrMap))
    +    val unboundToRefMap = expressions.zip(references).toMap
    +    val patchedWindowExpression = windowExpression.map(_.transform(unboundToRefMap))
         newMutableProjection(
           projectList ++ patchedWindowExpression,
    -      child.output ++ unboundToAttr.map(_._2))()
    +      child.output)()
    --- End diff --
    
    Currently, we put all the `windowResult` on the right side of `child.output`, patchedWindowExpression will be pointed to them.


---
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-11009] [SQL] fix wrong result of Window...

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

    https://github.com/apache/spark/pull/9050#issuecomment-147552566
  
    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 pull request: [SPARK-11009] [SQL] fix wrong result of Window...

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

    https://github.com/apache/spark/pull/9050#issuecomment-147601839
  
    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-11009] [SQL] fix wrong result of Window...

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

    https://github.com/apache/spark/pull/9050#issuecomment-147624248
  
      [Test build #43621 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/43621/console) for   PR 9050 at commit [`89c1401`](https://github.com/apache/spark/commit/89c140104ff931f4d5c154f754d9f43891cd600f).
     * 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


[GitHub] spark pull request: [SPARK-11009] [SQL] fix wrong result of Window...

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

    https://github.com/apache/spark/pull/9050#issuecomment-147620505
  
    Merged build started.


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