manuzhang commented on code in PR #14984:
URL: https://github.com/apache/iceberg/pull/14984#discussion_r3740908568


##########
spark/v4.2/spark-extensions/src/main/scala/org/apache/spark/sql/execution/datasources/v2/IcebergAlterV2ViewSchemaBindingExec.scala:
##########
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.spark.sql.execution.datasources.v2
+
+import org.apache.iceberg.spark.Spark3Util
+import org.apache.iceberg.spark.source.SparkView
+import org.apache.spark.sql.catalyst.InternalRow
+import org.apache.spark.sql.catalyst.analysis.ResolvedIdentifier
+import org.apache.spark.sql.catalyst.analysis.SchemaEvolution
+import org.apache.spark.sql.catalyst.analysis.ViewSchemaMode
+import org.apache.spark.sql.catalyst.analysis.ViewUtil
+import org.apache.spark.sql.catalyst.expressions.Attribute
+import org.apache.spark.sql.connector.catalog.Identifier
+import org.apache.spark.sql.connector.catalog.ViewCatalog
+import org.apache.spark.sql.execution.command.CommandUtils
+
+/** Executes ALTER VIEW ... WITH SCHEMA for Iceberg views. */
+case class IcebergAlterV2ViewSchemaBindingExec(
+    catalog: ViewCatalog,
+    ident: Identifier,
+    schemaMode: ViewSchemaMode)
+    extends LeafV2CommandExec {
+
+  override lazy val output: Seq[Attribute] = Nil
+
+  override protected def run(): Seq[InternalRow] = {
+    val icebergViewCatalog =
+      ViewUtil
+        .icebergViewCatalog(catalog, ident)
+        .getOrElse(

Review Comment:
   I’m keeping the invariant exception. An earlier review established that this 
exec is only created for an Iceberg-backed `ResolvedV2View` and requested 
`getOrElse(throw ...)`. Distinguishing a concurrent drop would require changing 
the helper contract separately.



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