You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "aokolnychyi (via GitHub)" <gi...@apache.org> on 2026/04/01 07:52:08 UTC
Re: [PR] [SPARK-55689] Skip unsupported column changes during schema evolution [spark]
aokolnychyi commented on code in PR #54658:
URL: https://github.com/apache/spark/pull/54658#discussion_r3020418948
##########
sql/catalyst/src/main/java/org/apache/spark/sql/connector/catalog/SupportsSchemaEvolution.java:
##########
@@ -0,0 +1,45 @@
+/*
+ * 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.connector.catalog;
+
+import org.apache.spark.annotation.Experimental;
+import org.apache.spark.sql.connector.catalog.TableChange.ColumnChange;
+
+/**
+ * A mix-in interface for {@link Table} schema evolution support. Data sources can implement this
+ * interface to indicate the schema changes they support during write operations. Tables must
+ * report capability {@link TableCapability#AUTOMATIC_SCHEMA_EVOLUTION} for schema evolution to
+ * happen.
+ * <p>
+ * During automatic schema evolution, Spark computes the set of column changes (e.g. adding a new
+ * column, widening a column type) needed to make the target table schema compatible with the
+ * source data schema. Each candidate change is passed to {@link #supportsColumnChange} to
+ * determine whether the data source can apply it. Changes that are not supported are skipped.
Review Comment:
I agree, it would be helpful to note that Spark will attempt to resolve such changes using casts and if that fails, then it will result in a failed query.
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org