You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by clockfly <gi...@git.apache.org> on 2016/08/12 03:05:26 UTC

[GitHub] spark pull request #14616: [SPARK-16955][SQL] Fix analysis error when using ...

GitHub user clockfly opened a pull request:

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

    [SPARK-16955][SQL] Fix analysis error when using ordinal in ORDER BY or GROUP BY

    ## What changes were proposed in this pull request?
    
    This PR adds two unresolved expressions to represent the ordinal in GROUP BY or ORDER BY `GroupByOrdinal` and `OrderByOrdinal`, and fixes the rules when resolving ordinals.
    
    Ordinals in GROUP BY or ORDER BY like `1` in `order by 1` or `group by 1` should be considered as unresolved expressions before analysis. But in current code, it is represented as a `Literal` expression directly, which is a resolved expression. It may cause analysis failure if a rule requires the ordinal to be resolved before applying.
    
    **For example:**
    
    Before this fix, rule `ResolveAggregateFunctions` will try to resolve the `Filter` before `Filter`'s child `Aggregate` is fully resolved (`Aggregate` contains an unresolved group by ordinal `2`) 
    
    ```
    'Filter ('a > 0)
       +- Aggregate [2], [count(1) AS count(1)#83L, a#81]
            +- SubqueryAlias tmp
                +- Project [1 AS a#81]
                     +- OneRowRelation$
    ```
    
    ### Before this change
    
    Ordinal is stored as `Literal` expression
    
    ```
    scala> sc.setLogLevel("TRACE")
    scala> sql("select a from t group by 1 order by 1")
    ...
    'Sort [1 ASC], true  
     +- 'Aggregate [1], ['a]
         +- 'UnresolvedRelation `t
    ```
    
    And it causes analysis error when applying rule ResolveAggregateFunctions, as group by ordinal `2` claim to have been resolved, but is not resolved actually.
    
    ```
    scala> Seq(1).toDF("a").createOrReplaceTempView("t")
    scala> sql("select count(a), a from t group by 2 having a > 0").show
    org.apache.spark.sql.catalyst.analysis.UnresolvedException: Invalid call to Group by position: '2' exceeds the size of the select list '1'. on unresolved object, tree:
    Aggregate [2], [(a#9 > 0) AS havingCondition#15]
    +- SubqueryAlias t
       +- Project [value#7 AS a#9]
          +- LocalRelation [value#7]
    ...
    ```
    
    ### After this change
    
    Ordinals are stored as `GroupByOrdinal` or `OrderByOrdinal`.
    
    ```
    scala> sc.setLogLevel("TRACE")
    scala> sql("select a from t group by 1 order by 1")
    ...
    'Sort [orderbyordinal(1) ASC], true
     +- 'Aggregate [groupbyordinal(1)], ['a]
          +- 'UnresolvedRelation `t`
    ```
    
    And rule ResolveAggregateFunctions can be safely applied as we have explicitly resolved `GroupByOrdinal(2)` before applying this rule. 
    
    ```
    scala> Seq(1).toDF("a").createOrReplaceTempView("t")
    scala> sql("select count(a), a from t group by 2 having a > 0").show
    +--------+---+                                                                  
    |count(a)|  a|
    +--------+---+
    |       1|  1|
    +--------+---+
    ```
    
    ## How was this patch tested?
    
    Unit tests.

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

    $ git pull https://github.com/clockfly/spark spark-16955

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

    https://github.com/apache/spark/pull/14616.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 #14616
    
----
commit 40873650c7397a339210092f616c15aedbf13b17
Author: Sean Zhong <se...@databricks.com>
Date:   2016-08-08T21:40:53Z

    [SPARK-16955][SQL] Fix analysis error when using ordinal in ORDER BY or GROUP BY

----


---
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 #14616: [SPARK-16955][SQL] Fix analysis error when using ...

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

    https://github.com/apache/spark/pull/14616#discussion_r74555566
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala ---
    @@ -2223,3 +2223,29 @@ object TimeWindowing extends Rule[LogicalPlan] {
           }
       }
     }
    +
    +/**
    + * Replaces ordinal in 'order by' or 'group by' with unresolved UnresolvedOrdinal expression.
    + */
    +class UnresolvedOrdinalSubstitution(conf: CatalystConf) extends Rule[LogicalPlan] {
    --- End diff --
    
    Ok.


---
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 #14616: [SPARK-16955][SQL] Fix analysis error when using ordinal...

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

    https://github.com/apache/spark/pull/14616
  
    **[Test build #63655 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/63655/consoleFull)** for PR 14616 at commit [`4087365`](https://github.com/apache/spark/commit/40873650c7397a339210092f616c15aedbf13b17).
     * This patch passes all tests.
     * This patch **does not merge cleanly**.
     * This patch adds the following public classes _(experimental)_:
      * `class OrderByOrdinalSubstitution(conf: CatalystConf) extends Rule[LogicalPlan] `
      * `class GroupByOrdinalSubstitution(conf: CatalystConf) extends Rule[LogicalPlan] `
      * `case class OrderByOrdinal(ordinal: Int)`
      * `case class GroupByOrdinal(ordinal: Int)`


---
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 #14616: [SPARK-16955][SQL] Fix analysis error when using ordinal...

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

    https://github.com/apache/spark/pull/14616
  
    Is there a way to fix this without introducing the new unresolved ordinal classes? If there isn't, can we combine the two into a single UnresolvedOrdinal?


---
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 #14616: [SPARK-16955][SQL] Fix analysis error when using ordinal...

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

    https://github.com/apache/spark/pull/14616
  
    **[Test build #63685 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/63685/consoleFull)** for PR 14616 at commit [`64ff518`](https://github.com/apache/spark/commit/64ff518e5df50a003df4d22e4f026c3f53142e86).
     * This patch **fails to build**.
     * 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 #14616: [SPARK-17034][SQL] adds expression UnresolvedOrdinal to ...

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

    https://github.com/apache/spark/pull/14616
  
    **[Test build #63684 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/63684/consoleFull)** for PR 14616 at commit [`3fe8982`](https://github.com/apache/spark/commit/3fe89826ffa70223154b60ca06fe7134ece570c0).
     * This patch **fails Spark unit tests**.
     * This patch merges cleanly.
     * This patch adds the following public classes _(experimental)_:
      * `class UnresolvedOrdinalSubstitution(conf: CatalystConf) extends Rule[LogicalPlan] `
      * `case class UnresolvedOrdinal(ordinal: Int)`


---
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 #14616: [SPARK-17034][SQL] adds expression UnresolvedOrdinal to ...

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

    https://github.com/apache/spark/pull/14616
  
    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 #14616: [SPARK-17034][SQL] adds expression UnresolvedOrdi...

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

    https://github.com/apache/spark/pull/14616#discussion_r74597680
  
    --- Diff: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/AnalysisSuite.scala ---
    @@ -377,4 +377,43 @@ class AnalysisSuite extends AnalysisTest {
         assertExpressionType(sum(Divide(Decimal(1), 2.0)), DoubleType)
         assertExpressionType(sum(Divide(1.0, Decimal(2.0))), DoubleType)
       }
    +
    +  test("test rule UnresolvedOrdinalSubstitution, replaces ordinal in order by or group by") {
    +    val a = testRelation2.output(0)
    +    val b = testRelation2.output(1)
    +    val conf = new SimpleCatalystConf(caseSensitiveAnalysis = true)
    +
    +    // Expression OrderByOrdinal is unresolved.
    +    assert(!UnresolvedOrdinal(0).resolved)
    +
    +    // Tests order by ordinal, apply single rule.
    +    val plan = testRelation2.orderBy(Literal(1).asc, Literal(2).asc)
    +    comparePlans(
    +      new UnresolvedOrdinalSubstitution(conf).apply(plan),
    --- End diff --
    
    I will creates a new test suite.


---
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 #14616: [SPARK-16955][SQL] Fix analysis error when using ordinal...

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

    https://github.com/apache/spark/pull/14616
  
    **[Test build #63670 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/63670/consoleFull)** for PR 14616 at commit [`9fc1b47`](https://github.com/apache/spark/commit/9fc1b477473d8b2de0567df3ae7d83e51ed9da97).


---
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 #14616: [SPARK-16955][SQL] Fix analysis error when using ordinal...

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

    https://github.com/apache/spark/pull/14616
  
    **[Test build #63678 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/63678/consoleFull)** for PR 14616 at commit [`094ac83`](https://github.com/apache/spark/commit/094ac8389fe1fca148f1c79f980c17f62deaaafb).
     * This patch **fails Spark unit tests**.
     * This patch merges cleanly.
     * This patch adds the following public classes _(experimental)_:
      * `class UnresolvedOrdinalSubstitution(conf: CatalystConf) extends Rule[LogicalPlan] `
      * `case class UnresolvedOrdinal(ordinal: Int)`


---
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 #14616: [SPARK-16955][SQL] Fix analysis error when using ordinal...

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

    https://github.com/apache/spark/pull/14616
  
    **[Test build #63684 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/63684/consoleFull)** for PR 14616 at commit [`3fe8982`](https://github.com/apache/spark/commit/3fe89826ffa70223154b60ca06fe7134ece570c0).


---
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 #14616: [SPARK-16955][SQL] Fix analysis error when using ...

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

    https://github.com/apache/spark/pull/14616#discussion_r74555215
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala ---
    @@ -2223,3 +2223,29 @@ object TimeWindowing extends Rule[LogicalPlan] {
           }
       }
     }
    +
    +/**
    + * Replaces ordinal in 'order by' or 'group by' with unresolved UnresolvedOrdinal expression.
    + */
    +class UnresolvedOrdinalSubstitution(conf: CatalystConf) extends Rule[LogicalPlan] {
    --- End diff --
    
    if we end up doing it this way, move this to its own file, and create an invididual test suite. 
    
    analyzer file is getting too large.


---
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 #14616: [SPARK-17034][SQL] adds expression UnresolvedOrdinal to ...

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

    https://github.com/apache/spark/pull/14616
  
    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 #14616: [SPARK-16955][SQL] Fix analysis error when using ordinal...

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

    https://github.com/apache/spark/pull/14616
  
    **[Test build #63678 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/63678/consoleFull)** for PR 14616 at commit [`094ac83`](https://github.com/apache/spark/commit/094ac8389fe1fca148f1c79f980c17f62deaaafb).


---
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 #14616: [SPARK-16955][SQL] Fix analysis error when using ordinal...

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

    https://github.com/apache/spark/pull/14616
  
    **[Test build #63655 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/63655/consoleFull)** for PR 14616 at commit [`4087365`](https://github.com/apache/spark/commit/40873650c7397a339210092f616c15aedbf13b17).


---
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 #14616: [SPARK-16955][SQL] Fix analysis error when using ordinal...

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

    https://github.com/apache/spark/pull/14616
  
    The bug described in JIRA is already fixed by https://github.com/apache/spark/pull/14595 by accident...
    
    shall we open a new JIRA as this PR is actually a refactor/cleanup?


---
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 #14616: [SPARK-17034][SQL] adds expression UnresolvedOrdinal to ...

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

    https://github.com/apache/spark/pull/14616
  
    **[Test build #63686 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/63686/consoleFull)** for PR 14616 at commit [`f800463`](https://github.com/apache/spark/commit/f800463a7989fcb731cf7a67adb37876cd44e127).
     * This patch **fails Spark unit tests**.
     * This patch merges cleanly.
     * This patch adds the following public classes _(experimental)_:
      * `class UnresolvedOrdinalSubstitution(conf: CatalystConf) extends Rule[LogicalPlan] `
      * `case class UnresolvedOrdinal(ordinal: Int)`


---
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 #14616: [SPARK-17034][SQL] adds expression UnresolvedOrdinal to ...

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

    https://github.com/apache/spark/pull/14616
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/63683/
    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 #14616: [SPARK-16955][SQL] Fix analysis error when using ordinal...

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

    https://github.com/apache/spark/pull/14616
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/63678/
    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 #14616: [SPARK-16955][SQL] Fix analysis error when using ordinal...

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

    https://github.com/apache/spark/pull/14616
  
    @cloud-fan 
    ResolveAggregateFunctions is only one reference of `Aggregate`, there can be other references? If not now, will we add some rule to reference Aggregate in future? The case here is that `Aggregate` itself is unresolved when it contains group by `ordinal`. The current fix is fail-proof for all potential usages.  


---
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 #14616: [SPARK-16955][SQL] Fix analysis error when using ordinal...

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

    https://github.com/apache/spark/pull/14616
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/63670/
    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 #14616: [SPARK-16955][SQL] Fix analysis error when using ordinal...

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

    https://github.com/apache/spark/pull/14616
  
    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 #14616: [SPARK-16955][SQL] Fix analysis error when using ordinal...

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

    https://github.com/apache/spark/pull/14616
  
    Ping @cloud-fan 


---
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 #14616: [SPARK-17034][SQL] adds expression UnresolvedOrdinal to ...

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

    https://github.com/apache/spark/pull/14616
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/63685/
    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 #14616: [SPARK-16955][SQL] Fix analysis error when using ordinal...

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

    https://github.com/apache/spark/pull/14616
  
    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 #14616: [SPARK-16955][SQL] Fix analysis error when using ordinal...

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

    https://github.com/apache/spark/pull/14616
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/63655/
    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 #14616: [SPARK-17034][SQL] adds expression UnresolvedOrdi...

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

    https://github.com/apache/spark/pull/14616#discussion_r74587978
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala ---
    @@ -32,7 +32,7 @@ import org.apache.spark.sql.catalyst.planning.IntegerIndex
     import org.apache.spark.sql.catalyst.plans._
     import org.apache.spark.sql.catalyst.plans.logical.{LogicalPlan, _}
     import org.apache.spark.sql.catalyst.rules._
    -import org.apache.spark.sql.catalyst.trees.TreeNodeRef
    +import org.apache.spark.sql.catalyst.trees.{CurrentOrigin, Origin, TreeNodeRef}
    --- End diff --
    
    no need to import 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 issue #14616: [SPARK-17034][SQL] adds expression UnresolvedOrdinal to ...

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

    https://github.com/apache/spark/pull/14616
  
    **[Test build #63821 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/63821/consoleFull)** for PR 14616 at commit [`db84e25`](https://github.com/apache/spark/commit/db84e259749e6b339367fd42305f92a224407399).


---
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 #14616: [SPARK-17034][SQL] adds expression UnresolvedOrdinal to ...

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

    https://github.com/apache/spark/pull/14616
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/63821/
    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 #14616: [SPARK-17034][SQL] adds expression UnresolvedOrdinal to ...

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

    https://github.com/apache/spark/pull/14616
  
    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 #14616: [SPARK-16955][SQL] Fix analysis error when using ...

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

    https://github.com/apache/spark/pull/14616#discussion_r74556035
  
    --- Diff: sql/core/src/test/resources/sql-tests/results/group-by-ordinal.sql.out ---
    @@ -95,7 +95,7 @@ select a, b from data group by -1
     struct<>
     -- !query 8 output
     org.apache.spark.sql.AnalysisException
    -GROUP BY position -1 is not in select list (valid range is [1, 2]); line 1 pos 31
    +GROUP BY position -1 is not in select list (valid range is [1, 2]); line 1 pos 22
    --- End diff --
    
    Sorry, I will fix this. I didn't understand the meaning of pos before.


---
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 #14616: [SPARK-16955][SQL] Fix analysis error when using ...

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

    https://github.com/apache/spark/pull/14616#discussion_r74556830
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala ---
    @@ -2223,3 +2223,29 @@ object TimeWindowing extends Rule[LogicalPlan] {
           }
       }
     }
    +
    +/**
    + * Replaces ordinal in 'order by' or 'group by' with unresolved UnresolvedOrdinal expression.
    + */
    +class UnresolvedOrdinalSubstitution(conf: CatalystConf) extends Rule[LogicalPlan] {
    +  private def isIntegerLiteral(sorter: Expression) = IntegerIndex.unapply(sorter).nonEmpty
    +
    +  def apply(plan: LogicalPlan): LogicalPlan = plan transform {
    +    case s @ Sort(orders, _, _) if conf.orderByOrdinal &&
    +      orders.exists(o => isIntegerLiteral(o.child)) =>
    +      val newOrders = orders.map {
    +        case order @ SortOrder(IntegerIndex(index), _) =>
    +          order.copy(child = UnresolvedOrdinal(index))
    --- End diff --
    
    we need a way to move the line position information.


---
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 #14616: [SPARK-16955][SQL] Fix analysis error when using ordinal...

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

    https://github.com/apache/spark/pull/14616
  
    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 #14616: [SPARK-17034][SQL] adds expression UnresolvedOrdinal to ...

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

    https://github.com/apache/spark/pull/14616
  
    **[Test build #63687 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/63687/consoleFull)** for PR 14616 at commit [`47f6534`](https://github.com/apache/spark/commit/47f65346bb18e26e59878e6918e444df663ae137).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds the following public classes _(experimental)_:
      * `class UnresolvedOrdinalSubstitution(conf: CatalystConf) extends Rule[LogicalPlan] `
      * `case class UnresolvedOrdinal(ordinal: Int)`


---
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 #14616: [SPARK-17034][SQL] adds expression UnresolvedOrdinal to ...

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

    https://github.com/apache/spark/pull/14616
  
    **[Test build #63683 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/63683/consoleFull)** for PR 14616 at commit [`c82adad`](https://github.com/apache/spark/commit/c82adad4ad0de8c62ec828688e97d849455ca367).
     * This patch **fails Spark unit tests**.
     * This patch merges cleanly.
     * This patch adds the following public classes _(experimental)_:
      * `class UnresolvedOrdinalSubstitution(conf: CatalystConf) extends Rule[LogicalPlan] `
      * `case class UnresolvedOrdinal(ordinal: Int)`


---
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 #14616: [SPARK-16955][SQL] Fix analysis error when using ordinal...

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

    https://github.com/apache/spark/pull/14616
  
    **[Test build #63683 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/63683/consoleFull)** for PR 14616 at commit [`c82adad`](https://github.com/apache/spark/commit/c82adad4ad0de8c62ec828688e97d849455ca367).


---
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 #14616: [SPARK-17034][SQL] adds expression UnresolvedOrdinal to ...

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

    https://github.com/apache/spark/pull/14616
  
    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 #14616: [SPARK-16955][SQL] Fix analysis error when using ordinal...

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

    https://github.com/apache/spark/pull/14616
  
    Can we just add a check in `ResolveAggregateFunctions`? If `groupByOrdinal` is enabled and aggregate expressions contains integral literals, we skip 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 #14616: [SPARK-17034][SQL] adds expression UnresolvedOrdinal to ...

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

    https://github.com/apache/spark/pull/14616
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/63687/
    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 #14616: [SPARK-17034][SQL] adds expression UnresolvedOrdi...

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

    https://github.com/apache/spark/pull/14616#discussion_r74588724
  
    --- Diff: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/AnalysisSuite.scala ---
    @@ -377,4 +377,43 @@ class AnalysisSuite extends AnalysisTest {
         assertExpressionType(sum(Divide(Decimal(1), 2.0)), DoubleType)
         assertExpressionType(sum(Divide(1.0, Decimal(2.0))), DoubleType)
       }
    +
    +  test("test rule UnresolvedOrdinalSubstitution, replaces ordinal in order by or group by") {
    +    val a = testRelation2.output(0)
    +    val b = testRelation2.output(1)
    +    val conf = new SimpleCatalystConf(caseSensitiveAnalysis = true)
    +
    +    // Expression OrderByOrdinal is unresolved.
    +    assert(!UnresolvedOrdinal(0).resolved)
    +
    +    // Tests order by ordinal, apply single rule.
    +    val plan = testRelation2.orderBy(Literal(1).asc, Literal(2).asc)
    +    comparePlans(
    +      new UnresolvedOrdinalSubstitution(conf).apply(plan),
    --- End diff --
    
    actually we don't have unit test for single analyzer rule yet, this suite is for the whole analyzer. We should write test like
    ```
    val query = testRelation2.orderBy(Literal(1).asc, Literal(2).asc)
    val expected = testRelation2.orderBy('a.asc, 'b.asc)
    checkAnalysis(query, expected)
    ```
    
    Or we can create a new suite and begin to test single analyzer rule


---
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 #14616: [SPARK-17034][SQL] adds expression UnresolvedOrdinal to ...

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

    https://github.com/apache/spark/pull/14616
  
    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 #14616: [SPARK-17034][SQL] adds expression UnresolvedOrdinal to ...

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

    https://github.com/apache/spark/pull/14616
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/63684/
    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 #14616: [SPARK-17034][SQL] adds expression UnresolvedOrdinal to ...

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

    https://github.com/apache/spark/pull/14616
  
    **[Test build #63821 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/63821/consoleFull)** for PR 14616 at commit [`db84e25`](https://github.com/apache/spark/commit/db84e259749e6b339367fd42305f92a224407399).
     * 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 issue #14616: [SPARK-16955][SQL] Fix analysis error when using ordinal...

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

    https://github.com/apache/spark/pull/14616
  
    **[Test build #63670 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/63670/consoleFull)** for PR 14616 at commit [`9fc1b47`](https://github.com/apache/spark/commit/9fc1b477473d8b2de0567df3ae7d83e51ed9da97).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds the following public classes _(experimental)_:
      * `class OrderByOrdinalSubstitution(conf: CatalystConf) extends Rule[LogicalPlan] `
      * `class GroupByOrdinalSubstitution(conf: CatalystConf) extends Rule[LogicalPlan] `
      * `case class OrderByOrdinal(ordinal: Int)`
      * `case class GroupByOrdinal(ordinal: Int)`


---
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 #14616: [SPARK-17034][SQL] adds expression UnresolvedOrdinal to ...

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

    https://github.com/apache/spark/pull/14616
  
    thanks, merging to master!


---
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 #14616: [SPARK-16955][SQL] Fix analysis error when using ordinal...

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

    https://github.com/apache/spark/pull/14616
  
    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 #14616: [SPARK-17034][SQL] adds expression UnresolvedOrdinal to ...

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

    https://github.com/apache/spark/pull/14616
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/63686/
    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 #14616: [SPARK-16955][SQL] Fix analysis error when using ...

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

    https://github.com/apache/spark/pull/14616#discussion_r74555273
  
    --- Diff: sql/core/src/test/resources/sql-tests/results/group-by-ordinal.sql.out ---
    @@ -95,7 +95,7 @@ select a, b from data group by -1
     struct<>
     -- !query 8 output
     org.apache.spark.sql.AnalysisException
    -GROUP BY position -1 is not in select list (valid range is [1, 2]); line 1 pos 31
    +GROUP BY position -1 is not in select list (valid range is [1, 2]); line 1 pos 22
    --- End diff --
    
    why does the position 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 issue #14616: [SPARK-16955][SQL] Fix analysis error when using ordinal...

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

    https://github.com/apache/spark/pull/14616
  
    **[Test build #63686 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/63686/consoleFull)** for PR 14616 at commit [`f800463`](https://github.com/apache/spark/commit/f800463a7989fcb731cf7a67adb37876cd44e127).


---
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 #14616: [SPARK-17034][SQL] adds expression UnresolvedOrdi...

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

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


---
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 #14616: [SPARK-16955][SQL] Fix analysis error when using ordinal...

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

    https://github.com/apache/spark/pull/14616
  
    @rxin 
    I have to introdce a new unresolved expression as "group by ordinal" and "order by ordinal" can be turned off by a config like "conf.groupByOrdinal" or "conf.orderByOrdinal".
    
    Yes, `UnresolvedOrdinal` is a good idea.


---
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 #14616: [SPARK-17034][SQL] adds expression UnresolvedOrdinal to ...

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

    https://github.com/apache/spark/pull/14616
  
    **[Test build #63687 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/63687/consoleFull)** for PR 14616 at commit [`47f6534`](https://github.com/apache/spark/commit/47f65346bb18e26e59878e6918e444df663ae137).


---
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 #14616: [SPARK-16955][SQL] Fix analysis error when using ordinal...

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

    https://github.com/apache/spark/pull/14616
  
    **[Test build #63685 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/63685/consoleFull)** for PR 14616 at commit [`64ff518`](https://github.com/apache/spark/commit/64ff518e5df50a003df4d22e4f026c3f53142e86).


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