Github user hvanhovell commented on a diff in the pull request:
https://github.com/apache/spark/pull/16168#discussion_r91051761
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/execution/command/views.scala ---
@@ -275,20 +297,26 @@ case class AlterViewAsCommand(
throw new AnalysisException(s"${viewMeta.identifier} is not a view.")
}
- val viewSQL: String = new SQLBuilder(analyzedPlan).toSQL
- // Validate the view SQL - make sure we can parse it and analyze it.
- // If we cannot analyze the generated query, there is probably a bug
in SQL generation.
- try {
- session.sql(viewSQL).queryExecution.assertAnalyzed()
+ val currentDatabase = session.sessionState.catalog.getCurrentDatabase
+
+ // Validate the view SQL - make sure we can resolve it with
currentDatabase.
+ val originalSchema = try {
--- End diff --
This is duplicate - should we put this into a common trait?
---
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]