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


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/interface.scala:
##########
@@ -401,6 +401,25 @@ case class CatalogTable(
     )
   }
 
+  /**
+   * Return the schema binding mode. Defaults to SchemaCompensation if not a 
view or an older
+   * version, unless the viewSchemaBinding config is set to UNSUPPORTED
+   */
+  def viewSchemaMode: ViewSchemaMode = {
+    if (SQLConf.get.viewSchemaBinding == "UNSUPPORTED") {
+      SchemaUnsupported
+    } else {
+      val schemaMode = properties.getOrElse(VIEW_SCHEMA_MODE, 
SchemaCompensation.toString)

Review Comment:
   Shall we use `SQLConf.get.viewSchemaBinding` as the default value instead of 
`SchemaCompensation.toString`? If we change the default value of the SQL conf 
in the future, we may miss updating this one.



-- 
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