gengliangwang commented on code in PR #46267:
URL: https://github.com/apache/spark/pull/46267#discussion_r1591551240


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/AstBuilder.scala:
##########
@@ -4996,6 +4996,60 @@ class AstBuilder extends DataTypeAstBuilder with 
SQLConfHelper with Logging {
       query = plan(ctx.query))
   }
 
+  /**
+   * Defined the schema binding mode during CREATE or ALTER VIEW.
+   * The method also accept a NULL context, in which case it will return the 
session default
+   *
+   * {{{
+   *   WITH SCHEMA [ BINDING | COMPENSATION | TYPE EVOLUTION | EVOLUTION ]
+   * }}}
+   */
+  override def visitSchemaBinding(ctx: SchemaBindingContext): ViewSchemaMode = 
{
+    if (ctx == null) {
+      // No schema binding specified, return the session default
+      conf.viewSchemaBinding match {
+        case SchemaBinding.toString => SchemaBinding
+        case SchemaEvolution.toString => SchemaEvolution
+        case SchemaCompensation.toString => SchemaCompensation
+        case SchemaTypeEvolution.toString => SchemaTypeEvolution
+        case other => SchemaUnsupported
+      }
+    } else if (SQLConf.get.viewSchemaBinding == "UNSUPPORTED") {

Review Comment:
   ```suggestion
       } else if (conf.viewSchemaBinding == "UNSUPPORTED") {
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to