Github user gatorsmile commented on the issue:
https://github.com/apache/spark/pull/12872
Yeah, `ALTER VIEW` should be consistent with `DROP VIEW`, if we use the
same naming rule. Should I submit a PR for it?
Another potential issue to users is the behaviors of `CRAETE VIEW` and
`CREATE TEMPORARY VIEW` when users do not specify the database names. See the
following example:
```
sql(s"CREATE TEMPORARY VIEW $viewName AS SELECT * FROM $tabName WHERE ID <
3")
sql(s"CREATE VIEW $viewName AS SELECT * FROM $tabName")
```
When we processing the second statement, we simply add `CURRENT_DATABASE`
to make it a fully qualified view name. However, if users do not specify the
fully qualified name in the subsequent SELECT/DROP, the persistent view is
shadowed by the temporary view with the same name. The returned results might
be a surprise to the Spark users, because they might not realize there exist a
temporary view in the existing session.
Of course, the existing behavior is right, but I think the better way is to
force users to specify the database name when creating a persistent view if
there exists a temporary view with the same name. That means, we can issue an
error message here in this specific case.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]