GitHub user rxin opened a pull request: https://github.com/apache/spark/pull/12633
[SPARK-14865][SQL] Better error handling for view creation. ## What changes were proposed in this pull request? This patch improves error handling in view creation. CreateViewCommand itself will analyze the view SQL query first, and if it cannot successfully analyze it, throw an AnalysisException. In addition, I also added the following two conservative guards for easier identification of Spark bugs: 1. If there is a bug and the generated view SQL cannot be analyzed, throw an exception at runtime. Note that this is not an AnalysisException because it is not caused by the user and more likely indicate a bug in Spark. 2. SQLBuilder when it gets an unresolved plan, it will also show the plan in the error message. I also took the chance to simplify the internal implementation of CreateViewCommand, and *removed* a fallback path that would've masked an exception from before. ## How was this patch tested? Updated unit tests. You can merge this pull request into a Git repository by running: $ git pull https://github.com/rxin/spark SPARK-14865 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/spark/pull/12633.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 #12633 ---- commit 2d4ddc803e7676d8d5a778ce2a09f63217835b2b Author: Reynold Xin <r...@databricks.com> Date: 2016-04-23T06:34:28Z [SPARK-14865][SQL] Better error handling for view creation. ---- --- 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