diff options
author | Nong Li <nongli@gmail.com> | 2015-11-02 20:32:08 -0800 |
---|---|---|
committer | Yin Huai <yhuai@databricks.com> | 2015-11-02 20:32:08 -0800 |
commit | 9cb5c731dadff9539126362827a258d6b65754bb (patch) | |
tree | acc95aefbc77ba4c6557b15cdbfb6d09ec2118d4 /sql/hive/src | |
parent | 2cef1bb0b560a03aa7308f694b0c66347b90c9ea (diff) | |
download | spark-9cb5c731dadff9539126362827a258d6b65754bb.tar.gz spark-9cb5c731dadff9539126362827a258d6b65754bb.tar.bz2 spark-9cb5c731dadff9539126362827a258d6b65754bb.zip |
[SPARK-11329][SQL] Support star expansion for structs.
1. Supporting expanding structs in Projections. i.e.
"SELECT s.*" where s is a struct type.
This is fixed by allowing the expand function to handle structs in addition to tables.
2. Supporting expanding * inside aggregate functions of structs.
"SELECT max(struct(col1, structCol.*))"
This requires recursively expanding the expressions. In this case, it it the aggregate
expression "max(...)" and we need to recursively expand its children inputs.
Author: Nong Li <nongli@gmail.com>
Closes #9343 from nongli/spark-11329.
Diffstat (limited to 'sql/hive/src')
-rw-r--r-- | sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveQl.scala | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveQl.scala b/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveQl.scala index 3697761f20..ab88c1e68f 100644 --- a/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveQl.scala +++ b/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveQl.scala @@ -1505,7 +1505,7 @@ https://cwiki.apache.org/confluence/display/Hive/Enhanced+Aggregation%2C+Cube%2C // The format of dbName.tableName.* cannot be parsed by HiveParser. TOK_TABNAME will only // has a single child which is tableName. case Token("TOK_ALLCOLREF", Token("TOK_TABNAME", Token(name, Nil) :: Nil) :: Nil) => - UnresolvedStar(Some(name)) + UnresolvedStar(Some(UnresolvedAttribute.parseAttributeName(name))) /* Aggregate Functions */ case Token("TOK_FUNCTIONSTAR", Token(COUNT(), Nil) :: Nil) => Count(Literal(1)) |