You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "zzzzming95 (Jira)" <ji...@apache.org> on 2023/02/27 05:31:00 UTC

[jira] [Created] (SPARK-42594) spark can not read lastest view sql when run `create or replace view` by hive

zzzzming95 created SPARK-42594:
----------------------------------

             Summary: spark can not read lastest view sql when run `create or replace view` by hive
                 Key: SPARK-42594
                 URL: https://issues.apache.org/jira/browse/SPARK-42594
             Project: Spark
          Issue Type: Bug
          Components: SQL
    Affects Versions: 3.3.2
            Reporter: zzzzming95


1. Spark would save view schema as tabel param. 
2. Spark will make tabel param as output schema when select the view .
3. Hive will not update tabel param when runing `create or replace view` to update the view.


So when hive and spark are mixed and update the view, spark may ignore some strings.


To reproduce this issue:

1. running in spark
```
create table test_spark (id string);
create view test_spark_view as select id from test_spark;
```

2. running in hive

```
create or replace view test_spark_view as select id , "test" as new_id from test_spark;

```

3. We can see spark will ignore `test_spark_view#new_id` when select test_spark_view using spark. But hive can read it.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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