diff options
author | Herman van Hovell <hvanhovell@databricks.com> | 2016-08-16 23:09:53 -0700 |
---|---|---|
committer | Reynold Xin <rxin@databricks.com> | 2016-08-16 23:09:53 -0700 |
commit | f7c9ff57c17a950cccdc26aadf8768c899a4d572 (patch) | |
tree | 6ff7233e26d192dac7d1af38708707e74d84401a /python/pyspark/sql/readwriter.py | |
parent | 4a2c375be2bcd98cc7e00bea920fd6a0f68a4e14 (diff) | |
download | spark-f7c9ff57c17a950cccdc26aadf8768c899a4d572.tar.gz spark-f7c9ff57c17a950cccdc26aadf8768c899a4d572.tar.bz2 spark-f7c9ff57c17a950cccdc26aadf8768c899a4d572.zip |
[SPARK-17068][SQL] Make view-usage visible during analysis
## What changes were proposed in this pull request?
This PR adds a field to subquery alias in order to make the usage of views in a resolved `LogicalPlan` more visible (and more understandable).
For example, the following view and query:
```sql
create view constants as select 1 as id union all select 1 union all select 42
select * from constants;
```
...now yields the following analyzed plan:
```
Project [id#39]
+- SubqueryAlias c, `default`.`constants`
+- Project [gen_attr_0#36 AS id#39]
+- SubqueryAlias gen_subquery_0
+- Union
:- Union
: :- Project [1 AS gen_attr_0#36]
: : +- OneRowRelation$
: +- Project [1 AS gen_attr_1#37]
: +- OneRowRelation$
+- Project [42 AS gen_attr_2#38]
+- OneRowRelation$
```
## How was this patch tested?
Added tests for the two code paths in `SessionCatalogSuite` (sql/core) and `HiveMetastoreCatalogSuite` (sql/hive)
Author: Herman van Hovell <hvanhovell@databricks.com>
Closes #14657 from hvanhovell/SPARK-17068.
Diffstat (limited to 'python/pyspark/sql/readwriter.py')
0 files changed, 0 insertions, 0 deletions