aokolnychyi commented on a change in pull request #3661: URL: https://github.com/apache/iceberg/pull/3661#discussion_r764352849
########## File path: spark/v3.2/spark-extensions/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/ReplaceData.scala ########## @@ -0,0 +1,63 @@ +/* + * 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.catalyst.plans.logical + +import org.apache.spark.sql.catalyst.analysis.NamedRelation +import org.apache.spark.sql.catalyst.expressions.Attribute +import org.apache.spark.sql.catalyst.util.CharVarcharUtils +import org.apache.spark.sql.connector.write.Write +import org.apache.spark.sql.types.DataType + +/** + * Replace data in an existing table. + */ +case class ReplaceData( + table: NamedRelation, + query: LogicalPlan, + originalTable: NamedRelation, + write: Option[Write] = None) extends V2WriteCommandLike { + + override lazy val resolved: Boolean = table.resolved && query.resolved && outputResolved + override lazy val stringArgs: Iterator[Any] = Iterator(table, query, write) + + // the incoming query may include metadata columns + lazy val dataInput: Seq[Attribute] = { Review comment: The projection is inserted only after the write is built as the extra columns can be part of the distribution and ordering requested by the write. -- 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]
