You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Apache Spark (JIRA)" <ji...@apache.org> on 2016/07/05 07:22:11 UTC
[jira] [Assigned] (SPARK-16374) Remove Alias from MetastoreRelation
and SimpleCatalogRelation
[ https://issues.apache.org/jira/browse/SPARK-16374?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Apache Spark reassigned SPARK-16374:
------------------------------------
Assignee: Apache Spark
> Remove Alias from MetastoreRelation and SimpleCatalogRelation
> -------------------------------------------------------------
>
> Key: SPARK-16374
> URL: https://issues.apache.org/jira/browse/SPARK-16374
> Project: Spark
> Issue Type: Improvement
> Components: SQL
> Affects Versions: 2.0.0
> Reporter: Xiao Li
> Assignee: Apache Spark
>
> Different from the other leaf nodes, `MetastoreRelation` and `SimpleCatalogRelation` have a pre-defined `alias`, which is used to change the qualifier of the node. However, based on the existing alias handling, alias should be put in `SubqueryAlias`.
> This PR is to separate alias handling from `MetastoreRelation` and `SimpleCatalogRelation` to make it consistent with the other nodes.
> For example, below is an example query for `MetastoreRelation`, which is converted to `LogicalRelation`:
> {noformat}
> SELECT tmp.a + 1 FROM test_parquet_ctas tmp WHERE tmp.a > 2
> {noformat}
> Before changes, the analyzed plan is
> {noformat}
> == Analyzed Logical Plan ==
> (a + 1): int
> Project [(a#951 + 1) AS (a + 1)#952]
> +- Filter (a#951 > 2)
> +- SubqueryAlias tmp
> +- Relation[a#951] parquet
> {noformat}
> After changes, the analyzed plan becomes
> {noformat}
> == Analyzed Logical Plan ==
> (a + 1): int
> Project [(a#951 + 1) AS (a + 1)#952]
> +- Filter (a#951 > 2)
> +- SubqueryAlias tmp
> +- SubqueryAlias test_parquet_ctas
> +- Relation[a#951] parquet
> {noformat}
> **Note: the optimized plans are the same.**
> For `SimpleCatalogRelation`, the existing code always generates two Subqueries. Thus, no change is needed.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org