You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Wenchen Fan (Jira)" <ji...@apache.org> on 2019/11/22 12:17:00 UTC

[jira] [Commented] (SPARK-30001) can't lookup v1 tables whose names specify the session catalog

    [ https://issues.apache.org/jira/browse/SPARK-30001?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16980101#comment-16980101 ] 

Wenchen Fan commented on SPARK-30001:
-------------------------------------

cc [~rdblue]  [~imback82]

> can't lookup v1 tables whose names specify the session catalog
> --------------------------------------------------------------
>
>                 Key: SPARK-30001
>                 URL: https://issues.apache.org/jira/browse/SPARK-30001
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 3.0.0
>            Reporter: Wenchen Fan
>            Priority: Major
>
> A simple way to reproduce it
> {code}
> scala> sql("create table t using hive as select 1 as i")
> res2: org.apache.spark.sql.DataFrame = []
> scala> sql("select * from t").show
> +---+
> |  i|
> +---+
> |  1|
> +---+
> scala> sql("select * from spark_catalog.t").show
> org.apache.spark.sql.AnalysisException: Table or view not found: spark_catalog.t; line 1 pos 14;
> 'Project [*]
> +- 'UnresolvedRelation [spark_catalog, t]
> {code}
> The reason is that, we first go into `ResolveTables`, which lookups the table successfully, but then give up because it's a v1 table. Next we go into `ResolveRelations`, which do not recognize catalog name at all.
> Similar to https://issues.apache.org/jira/browse/SPARK-29966 , we should make `ResolveRelations` responsible for lookup both v1 and v2 tables from the session catalog, and correctly recognize catalog name.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org