[ https://issues.apache.org/jira/browse/SPARK-41229?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
jingxiong zhong updated SPARK-41229: ------------------------------------ Description: SQL1: ```with table_hive1 as(select * from db1.table_hive) select * from db1.table_hive1;``` It will throw exception `org.apache.spark.sql.AnalysisException: Table or view not found: db1.table_hive1;`but spark in 2.4.3 work well. SQL2: ```with table_hive1 as(select * from db1.table_hive) select * from table_hive1;``` It work well. I'm a little confused. Is this syntax with database name not supported. you can run like this: create db1.table_hive(age int, name string); insert into db1.table_hive values(1, 'a'); insert into db1.table_hive values(2, 'b'); insert into db1.table_hive values(3, 'c'); with table_hive1 as(select * from db1.table_hive) select * from db1.table_hive1; was: SQL1: ```with table_hive1 as(select * from db1.table_hive) select * from db1.table_hive1;``` It will throw exception `org.apache.spark.sql.AnalysisException: Table or view not found: db1.table_hive1;`but spark in 2.4.3 work well. SQL2: ```with table_hive1 as(select * from db1.table_hive) select * from table_hive1;``` It work well. I'm a little confused. Is this syntax with database name not supported. you can run like this: create db1.table_hive(age int, name string); insert into db1.table_hive values(1, 'a'); insert into db1.table_hive values(2, 'b'); insert into db1.table_hive values(3, 'c'); `with table_hive1 as(select * from db1.table_hive) select * from db1.table_hive1;` > When using `db_ name.temp_ table_name`, an exception will be thrown > ------------------------------------------------------------------- > > Key: SPARK-41229 > URL: https://issues.apache.org/jira/browse/SPARK-41229 > Project: Spark > Issue Type: Bug > Components: SQL > Affects Versions: 3.2.0 > Environment: spark3.2.0 > hadoop2.7.3 > hive-ms 2.3.9 > Reporter: jingxiong zhong > Priority: Major > > SQL1: > ```with table_hive1 as(select * from db1.table_hive) > select * from db1.table_hive1;``` > It will throw exception `org.apache.spark.sql.AnalysisException: Table or > view not found: db1.table_hive1;`but spark in 2.4.3 work well. > SQL2: > ```with table_hive1 as(select * from db1.table_hive) > select * from table_hive1;``` > It work well. > I'm a little confused. Is this syntax with database name not supported. > you can run like this: > create db1.table_hive(age int, name string); > insert into db1.table_hive values(1, 'a'); > insert into db1.table_hive values(2, 'b'); > insert into db1.table_hive values(3, 'c'); > with table_hive1 as(select * from db1.table_hive) > select * from db1.table_hive1; -- This message was sent by Atlassian Jira (v8.20.10#820010) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org