rdblue commented on a change in pull request #1738: URL: https://github.com/apache/iceberg/pull/1738#discussion_r519069223
########## File path: spark3/src/main/java/org/apache/spark/sql/connector/write/RowLevelOperationsBuilder.java ########## @@ -0,0 +1,30 @@ +/* + * 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.write; + +import org.apache.spark.sql.connector.read.Scan; + +// TODO: how to represent merge-on-read? +// Option 1: Introduce DeltaBatchWrite that should be returned for merge-on-read only, use BatchWrite for copy-on-write +// Option 2: Introduce DeltaBatchWrite with keepUnchanged flag and use that flag to do copy-on-write/merge-on-read +public interface RowLevelOperationsBuilder { Review comment: What about adding `asScanBuilder` and `asWriteBuilder`? Then we could configure the scan and the write using the correct interface independently. The underlying implementation can instantiate both separately, too, and can do whatever it chooses to coordinate between the configuration across both builders. We would want to guarantee that the scan is configured and built first. The only information the scan needs is that it is part of a replace operation, so it should not push down filters within files (delete groups). For Iceberg, that's building a scan with `ignoreResiduals`. The write/replace operation needs information from a configured scan, so it should be built second. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
