GitHub user gatorsmile opened a pull request: https://github.com/apache/spark/pull/15174
[SPARK-17502] [SQL] [Backport] [2.0] Fix Multiple Bugs in DDL Statements on Temporary Views [WIP] ### What changes were proposed in this pull request? This PR is to backport https://github.com/apache/spark/pull/15054 to Spark 2.0. - When the permanent tables/views do not exist but the temporary view exists, the expected error should be `NoSuchTableException` for partition-related ALTER TABLE commands. However, it always reports a confusing error message. For example, ``` Partition spec is invalid. The spec (a, b) must match the partition spec () defined in table '`testview`'; ``` - When the permanent tables/views do not exist but the temporary view exists, the expected error should be `NoSuchTableException` for `ALTER TABLE ... UNSET TBLPROPERTIES`. However, it reports a missing table property. For example, ``` Attempted to unset non-existent property 'p' in table '`testView`'; ``` - When `ANALYZE TABLE` is called on a view or a temporary view, we should issue an error message. However, it reports a strange error: ``` ANALYZE TABLE is not supported for Project ``` - When inserting into a temporary view that is generated from `Range`, we will get the following error message: ``` assertion failed: No plan for 'InsertIntoTable Range (0, 10, step=1, splits=Some(1)), false, false +- Project [1 AS 1#20] +- OneRowRelation$ ``` This PR is to fix the above four issues. ### How was this patch tested? Added multiple test cases You can merge this pull request into a Git repository by running: $ git pull https://github.com/gatorsmile/spark PR15054Backport Alternatively you can review and apply these changes as the patch at: https://github.com/apache/spark/pull/15174.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 #15174 ---- commit 9efbe6b37b85637fdb6d511f2def8d62cd8a749a Author: gatorsmile <gatorsm...@gmail.com> Date: 2016-09-21T04:25:08Z fix. ---- --- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org