Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-14471][SQL] Aliases in SELECT could be used in GROUP BY #17191

Closed
wants to merge 23 commits into from

Conversation

maropu
Copy link
Member

@maropu maropu commented Mar 7, 2017

What changes were proposed in this pull request?

This pr added a new rule in Analyzer to resolve aliases in GROUP BY.
The current master throws an exception if GROUP BY clauses have aliases in SELECT;

scala> spark.sql("select a a1, a1 + 1 as b, count(1) from t group by a1")
org.apache.spark.sql.AnalysisException: cannot resolve '`a1`' given input columns: [a]; line 1 pos 51;
'Aggregate ['a1], [a#83L AS a1#87L, ('a1 + 1) AS b#88, count(1) AS count(1)#90L]
+- SubqueryAlias t
   +- Project [id#80L AS a#83L]
      +- Range (0, 10, step=1, splits=Some(8))

  at org.apache.spark.sql.catalyst.analysis.package$AnalysisErrorAt.failAnalysis(package.scala:42)
  at org.apache.spark.sql.catalyst.analysis.CheckAnalysis$$anonfun$checkAnalysis$1$$anonfun$apply$2.applyOrElse(CheckAnalysis.scala:77)
  at org.apache.spark.sql.catalyst.analysis.CheckAnalysis$$anonfun$checkAnalysis$1$$anonfun$apply$2.applyOrElse(CheckAnalysis.scala:74)
  at org.apache.spark.sql.catalyst.trees.TreeNode$$anonfun$transformUp$1.apply(TreeNode.scala:289)

How was this patch tested?

Added tests in SQLQuerySuite and SQLQueryTestSuite.

@SparkQA
Copy link

SparkQA commented Mar 7, 2017

Test build #74110 has finished for PR 17191 at commit 3ba9e44.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@nsyca
Copy link
Contributor

nsyca commented Mar 7, 2017

@maropu Would your code work for the problem in the PR description?

sql("create table t(a int) using parquet")
sql("select a a1, a1 + 1 as b, count(1) from t group by a1")

@maropu
Copy link
Member Author

maropu commented Mar 8, 2017

@nsyca oh, good suggestion. yes, it seems the case does not work. I'll update this pr soon. Thanks!

@SparkQA
Copy link

SparkQA commented Mar 10, 2017

Test build #74320 has finished for PR 17191 at commit 034f51f.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

checkAnswer(
sql("SELECT k1 AS key1, key1 + 1 AS key2, COUNT(1) FROM t GROUP BY key1, key2"),
Row(1, 2, 2) :: Row(2, 3, 1) :: Nil)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if the alias has a collision with a valid column name, like,

select k1 as k2, k2 from t
select k1 as k2 from t group by k1
select k1 as k2 from t group by k2

This would be an interesting test case to add.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the target of this pr just replaces unresolved exprs in grouping keys with resolved ones by using resolved exprs in SELECT clauses. So, I think we'd better to discuss the name collision case you described in follow-up other tickets.

q.resolveChildren(nameParts, resolver).getOrElse {
resolvedExprs.find(ne => resolver(ne.name, u.name)).getOrElse(u)
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With your new code, unresolved attributes will get a second chance to be resolved with any aliases in ALL operators. Is this an intended behaviour? If it is, you'd better update the PR description. The description currently refers to aliases in SELECT to be used in GROUP BY.

Using your definition in the new test cases:

Seq((1, "a", 0), (2, "a", 1), (1, "a", 2)).toDF("k1", "k2", "v").createOrReplaceTempView("t")

You can see that when there is a name collision, it shows a different behaviour. The one below has the unresolved kx in GROUP BY clause resolved to k1.

sql("select k1 as kx from t group by kx")

While this one below returns an error that k1 in SELECT clause is not found in GROUP BY clause.

sql("select k1 as k2 from t group by k2")

I think it'd better to go back to the drawing board and make a decision what we are going to support before we verify the code works as designed.

@nsyca
Copy link
Contributor

nsyca commented Mar 13, 2017

@maropu: I have made a few comments in the code and test cases. IMO, we should go back to define what we want to fix before jumping into the code.

I am sorry if my previous statement gave you an impression that we need to solve the problem in your PR description. I personally think the example in your PR description goes too far to resolve an undefined column in the SELECT clause from any aliases from its LHS.

Example:

select k1 as kx, kx from t

I think this should result in an error that kx is an undefined column from table t.

IMO, the problem we want to focus is to resolve any unresolved references in a GROUP BY clause by trying to map them to the aliases in the SELECT clause. That is, assuming table t contains column k1 and k2`,

select k1 as k2 from t group by k2

should resolve in an error that k1 is not part of the GROUP BY clause whereas

select k1 as kx from t group by kx

should resolve the unresolved reference kx in the GROUP BY clause with the alias kx from the column k1 in the SELECT clause.

It may be that the code in your first commit is good for the above problem definition.

You may want to involve any committers who are willing to concur with your problem definition, review your code and merge it in. In any case, the PR description should be updated and the test cases with name collision between aliases in SELECT clause and valid columns in the table should be added.

@maropu
Copy link
Member Author

maropu commented Mar 15, 2017

Ah, I see. In a basic stance, I think we should do the same behaviour with existing databases. You're right and select k1 as kx from t group by kx should fail;

// PostgreSQL
 Column |  Type   | Modifiers
--------+---------+-----------
 key    | integer |
 value  | integer |

postgres=# select key AS k, k FROM t;
ERROR:  column "k" does not exist at character 18

Anyway, I agree with your suggestion; we should make PRs as much small as possible, and so I reconsider this pr again to fix the point in the description.

@SparkQA
Copy link

SparkQA commented Mar 15, 2017

Test build #74585 has started for PR 17191 at commit c4b40aa.

@maropu
Copy link
Member Author

maropu commented Mar 15, 2017

Jenkins, retest this please.

@dilipbiswal
Copy link
Contributor

@maropu Hello, Perhaps you have already seen .. there have been PRs to fix this in the past. Here are a few i could find -

#12794 by @dongjoon-hyun
#10967 by @kevinyu98
Some more discussions on https://issues.apache.org/jira/browse/SPARK-9338.

Hope this helps ..

@SparkQA
Copy link

SparkQA commented Mar 15, 2017

Test build #74589 has finished for PR 17191 at commit c4b40aa.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@maropu
Copy link
Member Author

maropu commented Mar 15, 2017

@dilipbiswal oh, I didn't notice that. I check them and I'll close this. Thanks!

@dilipbiswal
Copy link
Contributor

dilipbiswal commented Mar 15, 2017

@maropu We may want to implement this extension if mysql and postgres support it. Just wanted to point you to the past discussions on this topic. Do we know if hive allows this ?

@dongjoon-hyun
Copy link
Member

dongjoon-hyun commented Mar 15, 2017

@maropu . I think you had better ask committers before closing this issue once more.

@gatorsmile
Copy link
Member

Could you please do a check which systems support it and which systems disallow it? Thanks!

@maropu
Copy link
Member Author

maropu commented Mar 16, 2017

okay, I'll check

@maropu
Copy link
Member Author

maropu commented Mar 16, 2017

@gatorsmile I checked;

// PostgreSQL v9.5
postgres=# \d t
   Table "public.t"
 Column |  Type   | Modifiers 
--------+---------+-----------
 gkey   | integer | 
 value  | integer | 

postgres=# SELECT gkey AS k, COUNT(value) FROM t GROUP BY k;
 k  | count 
----+-------
  1 |     1
(1 row)

// MySQL v5.7.13 
mysql> SHOW COLUMNS FROM t1;
+-------+---------+------+-----+---------+-------+
| Field | Type    | Null | Key | Default | Extra |
+-------+---------+------+-----+---------+-------+
| gkey  | int(11) | YES  |     | NULL    |       |
| value | int(11) | YES  |     | NULL    |       |
+-------+---------+------+-----+---------+-------+
2 rows in set (0.00 sec)

mysql> SELECT gkey AS k, COUNT(value) FROM t1 GROUP BY k;
+------+--------------+
| k    | count(value) |
+------+--------------+
|    1 |            1 |
+------+--------------+
1 row in set (0.00 sec)

// SQLite v3.8.8.3
Use ".open FILENAME" to reopen on a persistent database.

sqlite> .schema
CREATE TABLE t(gkey int, value int);

sqlite> SELECT gkey AS k, COUNT(value) FROM t GROUP BY k;
1|1

// Hive v2.0.1
hive> describe t;
OK
gkey                    int                                         
value                   int                                         
Time taken: 0.09 seconds, Fetched: 2 row(s)

hive> SELECT gkey AS k, COUNT(value) FROM t GROUP BY k;
FAILED: SemanticException [Error 10004]: Line 1:47 Invalid table alias or column reference 'k': (possible column names are: gkey, value)

And you know Oracle and SQLServer does not support this syntax;
#10967 (comment)

In summary,
Supported: PostgreSQL, MySQL, and SQLite
Not-Supported: Hive, Oracle, and SQLServer

WDYT?

@gatorsmile
Copy link
Member

We hit this issue multiple times. Although it looks not right to support it for the users of major enterprise RDBMS, two popular open source RDBMS PostgreSQL and MySQL support it.

This is the design decision we need to make. Should we keep the previous decision? @rxin @marmbrus @hvanhovell @cloud-fan Thanks!

@rxin
Copy link
Contributor

rxin commented Mar 16, 2017

I personally have run into this issue and was surprised that we didn't support it ... it's pretty verbose to retype everything.

If Postgres and MySQL both support it, I think we should do it too!

Can we introduce a config flag to not break old workloads?

@SparkQA
Copy link

SparkQA commented Mar 16, 2017

Test build #74677 has finished for PR 17191 at commit f62a75a.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

}.getOrElse(u)
case e => e
})

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Should we place this Aggregate pattern next to the other Aggregate that deals with the wildcard character (*) above? Otherwise, LGTM.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code block you suggested has some rules for replacing wildcards and so I feel putting this rule there is a little weird. But, I don't have a strong opinion on this, so both is okay to me.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@maropu I did not suggest to merge the two code blocks. I suggested to move them next to each other so readers will easily see the code handling Aggregate with two different patterns.

@maropu
Copy link
Member Author

maropu commented Mar 17, 2017

I'll add a config soon

@cloud-fan
Copy link
Contributor

It's kind of weird if we have both "group by ordinal" feature and this "group by alias" feature, shall we only pick one of them?

@SparkQA
Copy link

SparkQA commented Mar 17, 2017

Test build #74712 has finished for PR 17191 at commit c25b1b3.

  • This patch fails Scala style tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@maropu
Copy link
Member Author

maropu commented Mar 17, 2017

@cloud-fan Even in the mixed case, it seems PotgreSQL and MySQL support the syntax;


// PostgreSQL v9.5
postgres=# \d t2
      Table "public.t2"
 Column |  Type   | Modifiers 
--------+---------+-----------
 gkey1  | integer | 
 gkey2  | integer | 
 value  | integer | 

postgres=# select gkey1 AS key1, gkey2, count(value) from t2 group by key1, 2;
 key1 | gkey2 | count 
------+-------+-------
    1 |     1 |     1
(1 row)

// MySQL v5.7.13 
mysql> SHOW COLUMNS FROM t2;
+-------+---------+------+-----+---------+-------+
| Field | Type    | Null | Key | Default | Extra |
+-------+---------+------+-----+---------+-------+
| gkey1 | int(11) | YES  |     | NULL    |       |
| gkey2 | int(11) | YES  |     | NULL    |       |
| value | int(11) | YES  |     | NULL    |       |
+-------+---------+------+-----+---------+-------+
3 rows in set (0.00 sec)

mysql> select gkey1 AS key1, gkey2, count(value) from t2 group by key1, 2;
+------+-------+--------------+
| key1 | gkey2 | count(value) |
+------+-------+--------------+
|    1 |     1 |            1 |
+------+-------+--------------+
1 row in set (0.00 sec)

@SparkQA
Copy link

SparkQA commented Mar 17, 2017

Test build #74713 has finished for PR 17191 at commit 5d8c853.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@cloud-fan
Copy link
Contributor

ok makes sense, let's support it

@maropu
Copy link
Member Author

maropu commented Mar 17, 2017

okay, I'll recheck the code and add tests for the case.

@maropu
Copy link
Member Author

maropu commented Apr 26, 2017

I tried to move ResolveOrdinalInOrderByAndGroupBy and ResolveAggAliasInGroupBy into postHocResolutionRules(commit), but I found I got some exceptions in SQLQueryTestSuite. To solve the exceptions, we need to move some rules there, too (e.g., ResolveMissingReferences, ResolveSubquery, and ResolveAggregateFunctions). WDYT? cc: @cloud-fan

@SparkQA
Copy link

SparkQA commented Apr 26, 2017

Test build #76187 has finished for PR 17191 at commit 1340862.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@maropu
Copy link
Member Author

maropu commented Apr 26, 2017

For now, I reverted the latest commit and I'll look for other better way to fix this.

@SparkQA
Copy link

SparkQA commented Apr 27, 2017

Test build #76202 has finished for PR 17191 at commit 65f6e7c.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

override def apply(plan: LogicalPlan): LogicalPlan = plan.resolveOperators {
case agg @ Aggregate(groups, aggs, child)
if conf.groupByAliases && child.resolved && aggs.forall(_.resolved) &&
groups.exists(!_.resolved) =>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: we can check groups.exists(_.isInstanceOf[UnresolvedAttribute])

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@@ -998,6 +998,22 @@ class Analyzer(
}

/**
* Replace unresolved expressions in grouping keys with resolved ones in SELECT clauses.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a comment to say that this rule has to be run after ResolveReferences

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, I'll update


override def apply(plan: LogicalPlan): LogicalPlan = plan.resolveOperators {
case agg @ Aggregate(groups, aggs, child)
if conf.groupByAliases && child.resolved && aggs.forall(_.resolved) &&
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not very confident about this condition, we may mistakenly resolve grouping expression by aggregate list while it should be resolved by child output.

one example is the star. If the aggregate list contains a star, then we will expand the star in ResolveReferences, without resolving grouping expressions. When we reach here, the condition will match but the grouping expression should not be resolved by aggregate list.

cc @gatorsmile

Copy link
Member Author

@maropu maropu Apr 27, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think an UnresolvedAttribute in grouping expressions here already implicitly indicates it is not in child plan's output?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not 100% sure though, since the resolution batch currently has this rule, it seems this rule is firstly applied into unresolved grouping keys in the star case @cloud-fan suggested.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the UnresolvedAttribute in grouping expressions that can be resolved by child's output, should be already resolved by ResolveReferences.

Copy link
Member Author

@maropu maropu Apr 27, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got debug info and it seemed ResolveAggAliasInGroupBy was firstly applied in that case?

scala> sql("SELECT *, count(1) FROM (select 1 AS a, 1 AS b) GROUP BY a, b").show

=== Applying Rule org.apache.spark.sql.catalyst.analysis.Analyzer$ResolveReferences ===
!'Aggregate ['a, 'b], [*, unresolvedalias('count(1), None)]   'Aggregate ['a, 'b], [a#0, b#1, unresolvedalias('count(1), None)]
 +- Project [1 AS a#0, 1 AS b#1]                              +- Project [1 AS a#0, 1 AS b#1]
    +- OneRowRelation$                                           +- OneRowRelation$

<-- ResolveAggAliasInGroupBy applied -->

=== Applying Rule org.apache.spark.sql.catalyst.analysis.Analyzer$ResolveFunctions ===
!'Aggregate ['a, 'b], [a#0, b#1, unresolvedalias('count(1), None)]   'Aggregate ['a, 'b], [a#0, b#1, unresolvedalias(count(1), None)]
 +- Project [1 AS a#0, 1 AS b#1]                                     +- Project [1 AS a#0, 1 AS b#1]
    +- OneRowRelation$                                                  +- OneRowRelation$

=== Applying Rule org.apache.spark.sql.catalyst.analysis.Analyzer$ResolveAliases ===
!'Aggregate ['a, 'b], [a#0, b#1, unresolvedalias(count(1), None)]   'Aggregate ['a, 'b], [a#0, b#1, count(1) AS count(1)#3L]
 +- Project [1 AS a#0, 1 AS b#1]                                    +- Project [1 AS a#0, 1 AS b#1]
    +- OneRowRelation$                                                 +- OneRowRelation$

=== Applying Rule org.apache.spark.sql.catalyst.analysis.Analyzer$ResolveReferences ===
!'Aggregate ['a, 'b], [a#0, b#1, count(1) AS count(1)#3L]   Aggregate [a#0, b#1], [a#0, b#1, count(1) AS count(1)#3L]
 +- Project [1 AS a#0, 1 AS b#1]                            +- Project [1 AS a#0, 1 AS b#1]
    +- OneRowRelation$                                         +- OneRowRelation$

<-- ResolveAggAliasInGroupBy applied -->

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok I have an idea: first, check there is UnresolvedAttribute in grouping expression, then check these UnresolvedAttributes can't be resolved by child.output.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The latest fix is not enough for your suggestion?;
This fix checks if UnresolvedAttribute exists there, then filter out by child.output.
https://github.com/apache/spark/pull/17191/files#diff-57b3d87be744b7d79a9beacf8e5e5eb2R1014

 +        // This is a strict check though, we put this to apply the rule only in alias expressions
 +        def checkIfChildOutputHasNo(attrName: String): Boolean =
 +          !child.output.exists(a => resolver(a.name, attrName))
 +        agg.copy(groupingExpressions = groups.map {
 +          case u: UnresolvedAttribute if checkIfChildOutputHasNo(u.name) =>
 +            aggs.find(ne => resolver(ne.name, u.name)).getOrElse(u)
 +          case e => e
 +        })

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yea it works, but maybe give it a better name like notResolvableByChild

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@SparkQA
Copy link

SparkQA commented Apr 27, 2017

Test build #76218 has finished for PR 17191 at commit 7264150.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Apr 27, 2017

Test build #76220 has finished for PR 17191 at commit 0ae48d8.

  • This patch fails SparkR unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@maropu
Copy link
Member Author

maropu commented Apr 27, 2017

Jenkins, retest this please.

@SparkQA
Copy link

SparkQA commented Apr 27, 2017

Test build #76224 has finished for PR 17191 at commit 0ae48d8.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Apr 27, 2017

Test build #76232 has finished for PR 17191 at commit d3071fa.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@maropu
Copy link
Member Author

maropu commented Apr 27, 2017

@cloud-fan ok, could you check again? Thanks!

@@ -998,6 +998,27 @@ class Analyzer(
}

/**
* Replace unresolved expressions in grouping keys with resolved ones in SELECT clauses.
* This rule is expected to run after [[ResolveReferences]] applied.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can remove this now. With the new check, the order doesn't matter

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@cloud-fan
Copy link
Contributor

thanks, mering to master/2.2!

asfgit pushed a commit that referenced this pull request Apr 28, 2017
## What changes were proposed in this pull request?
This pr added a new rule in `Analyzer` to resolve aliases in `GROUP BY`.
The current master throws an exception if `GROUP BY` clauses have aliases in `SELECT`;
```
scala> spark.sql("select a a1, a1 + 1 as b, count(1) from t group by a1")
org.apache.spark.sql.AnalysisException: cannot resolve '`a1`' given input columns: [a]; line 1 pos 51;
'Aggregate ['a1], [a#83L AS a1#87L, ('a1 + 1) AS b#88, count(1) AS count(1)#90L]
+- SubqueryAlias t
   +- Project [id#80L AS a#83L]
      +- Range (0, 10, step=1, splits=Some(8))

  at org.apache.spark.sql.catalyst.analysis.package$AnalysisErrorAt.failAnalysis(package.scala:42)
  at org.apache.spark.sql.catalyst.analysis.CheckAnalysis$$anonfun$checkAnalysis$1$$anonfun$apply$2.applyOrElse(CheckAnalysis.scala:77)
  at org.apache.spark.sql.catalyst.analysis.CheckAnalysis$$anonfun$checkAnalysis$1$$anonfun$apply$2.applyOrElse(CheckAnalysis.scala:74)
  at org.apache.spark.sql.catalyst.trees.TreeNode$$anonfun$transformUp$1.apply(TreeNode.scala:289)
```

## How was this patch tested?
Added tests in `SQLQuerySuite` and `SQLQueryTestSuite`.

Author: Takeshi Yamamuro <yamamuro@apache.org>

Closes #17191 from maropu/SPARK-14471.

(cherry picked from commit 59e3a56)
Signed-off-by: Wenchen Fan <wenchen@databricks.com>
@asfgit asfgit closed this in 59e3a56 Apr 28, 2017
ghost pushed a commit to dbtsai/spark that referenced this pull request May 12, 2017
## What changes were proposed in this pull request?
This pr added  `Analyzer` code for supporting aliases in CUBE/ROLLUP/GROUPING SETS (This is follow-up of apache#17191).

## How was this patch tested?
Added tests in `SQLQueryTestSuite`.

Author: Takeshi Yamamuro <yamamuro@apache.org>

Closes apache#17948 from maropu/SPARK-20710.
asfgit pushed a commit that referenced this pull request May 12, 2017
## What changes were proposed in this pull request?
This pr added  `Analyzer` code for supporting aliases in CUBE/ROLLUP/GROUPING SETS (This is follow-up of #17191).

## How was this patch tested?
Added tests in `SQLQueryTestSuite`.

Author: Takeshi Yamamuro <yamamuro@apache.org>

Closes #17948 from maropu/SPARK-20710.

(cherry picked from commit 92ea7fd)
Signed-off-by: Wenchen Fan <wenchen@databricks.com>
robert3005 pushed a commit to palantir/spark that referenced this pull request May 19, 2017
## What changes were proposed in this pull request?
This pr added  `Analyzer` code for supporting aliases in CUBE/ROLLUP/GROUPING SETS (This is follow-up of apache#17191).

## How was this patch tested?
Added tests in `SQLQueryTestSuite`.

Author: Takeshi Yamamuro <yamamuro@apache.org>

Closes apache#17948 from maropu/SPARK-20710.
liyichao pushed a commit to liyichao/spark that referenced this pull request May 24, 2017
## What changes were proposed in this pull request?
This pr added  `Analyzer` code for supporting aliases in CUBE/ROLLUP/GROUPING SETS (This is follow-up of apache#17191).

## How was this patch tested?
Added tests in `SQLQueryTestSuite`.

Author: Takeshi Yamamuro <yamamuro@apache.org>

Closes apache#17948 from maropu/SPARK-20710.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
9 participants