GitHub user cloud-fan opened a pull request:
https://github.com/apache/spark/pull/14893
[SPARK-17180][SPARK-17309][SPARK-17323][SQL][2.0] create AlterViewAsCommand
to handle ALTER VIEW AS
## What changes were proposed in this pull request?
Currently we use `CreateViewCommand` to implement ALTER VIEW AS, which has
3 bugs:
1. SPARK-17180: ALTER VIEW AS should alter temp view if view name has no
database part and temp view exists
2. SPARK-17309: ALTER VIEW AS should issue exception if view does not exist.
3. SPARK-17323: ALTER VIEW AS should keep the previous table properties,
comment, create_time, etc.
The root cause is, ALTER VIEW AS is quite different from CREATE VIEW, we
need different code path to handle them. However, in `CreateViewCommand`, there
is no way to distinguish ALTER VIEW AS and CREATE VIEW, we have to introduce
extra flag. But instead of doing this, I think a more natural way is to
separate the ALTER VIEW AS logic into a new command.
backport https://github.com/apache/spark/pull/14874 to 2.0
## How was this patch tested?
new tests in SQLViewSuite
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/cloud-fan/spark minor4
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/14893.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #14893
----
commit 75935a86cd8f5a5682b549d23f000d1190a412cb
Author: Wenchen Fan <[email protected]>
Date: 2016-08-31T10:02:20Z
create AlterViewAsCommand to handle ALTER VIEW AS
----
---
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]