Dongjoon Hyun created SPARK-18169:
-------------------------------------

             Summary: Suppress warnings when dropping views on a dropped table
                 Key: SPARK-18169
                 URL: https://issues.apache.org/jira/browse/SPARK-18169
             Project: Spark
          Issue Type: Bug
          Components: SQL
    Affects Versions: 2.0.1, 2.0.0
            Reporter: Dongjoon Hyun
            Priority: Minor


Apache Spark 2.0.0 ~ 2.0.2-rc1 shows an inconsistent *AnalysisException* 
warning message when dropping a *view* on a dropped table. This does not happen 
on dropping *temporary views*. Also, Spark 1.6.x does not show warnings. We had 
better suppress this to be more consistent in Spark 2.x and with Spark 1.6.x.

{code}
scala> sql("create table t(a int)")

scala> sql("create view v as select * from t")

scala> sql("create temporary view tv as select * from t")

scala> sql("drop table t")

scala> sql("drop view tv")

scala> sql("drop view v")
16/10/29 15:50:03 WARN DropTableCommand: 
org.apache.spark.sql.AnalysisException: Table or view not found: `default`.`t`; 
line 1 pos 91;
'SubqueryAlias v, `default`.`v`
+- 'Project ['gen_attr_0 AS a#19]
   +- 'SubqueryAlias t
      +- 'Project ['gen_attr_0]
         +- 'SubqueryAlias gen_subquery_0
            +- 'Project ['a AS gen_attr_0#18]
               +- 'UnresolvedRelation `default`.`t`

org.apache.spark.sql.AnalysisException: Table or view not found: `default`.`t`; 
line 1 pos 91;
'SubqueryAlias v, `default`.`v`
+- 'Project ['gen_attr_0 AS a#19]
   +- 'SubqueryAlias t
      +- 'Project ['gen_attr_0]
         +- 'SubqueryAlias gen_subquery_0
            +- 'Project ['a AS gen_attr_0#18]
               +- 'UnresolvedRelation `default`.`t`
...
res5: org.apache.spark.sql.DataFrame = []
{code}

Note that this is different case of dropping non-exist view. For the non-exist 
view, Spark raises NoSuchTableException.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to