[ https://issues.apache.org/jira/browse/HIVE-26102?focusedWorklogId=753909&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-753909 ]
ASF GitHub Bot logged work on HIVE-26102: ----------------------------------------- Author: ASF GitHub Bot Created on: 07/Apr/22 08:53 Start Date: 07/Apr/22 08:53 Worklog Time Spent: 10m Work Description: pvary commented on code in PR #3131: URL: https://github.com/apache/hive/pull/3131#discussion_r844885993 ########## iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/FilesForCommit.java: ########## @@ -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.iceberg.mr.hive; + +import java.io.Serializable; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import org.apache.iceberg.ContentFile; +import org.apache.iceberg.DataFile; +import org.apache.iceberg.DeleteFile; + +public class FilesForCommit implements Serializable { + + private final List<DataFile> dataFiles; + private final List<DeleteFile> deleteFiles; + + public FilesForCommit(List<DataFile> dataFiles, List<DeleteFile> deleteFiles) { + this.dataFiles = dataFiles; + this.deleteFiles = deleteFiles; + } + + public static FilesForCommit onlyDelete(List<DeleteFile> deleteFiles) { + return new FilesForCommit(Collections.emptyList(), deleteFiles); + } + + public static FilesForCommit onlyData(List<DataFile> dataFiles) { + return new FilesForCommit(dataFiles, Collections.emptyList()); + } + + public static FilesForCommit empty() { + return new FilesForCommit(Collections.emptyList(), Collections.emptyList()); + } + + public List<DataFile> getDataFiles() { Review Comment: In the Iceberg related code we usually try to avoid `get`. We might want to use `dataFiles()` instead Issue Time Tracking ------------------- Worklog Id: (was: 753909) Time Spent: 7h 40m (was: 7.5h) > Implement DELETE statements for Iceberg tables > ---------------------------------------------- > > Key: HIVE-26102 > URL: https://issues.apache.org/jira/browse/HIVE-26102 > Project: Hive > Issue Type: New Feature > Reporter: Marton Bod > Assignee: Marton Bod > Priority: Major > Labels: pull-request-available > Time Spent: 7h 40m > Remaining Estimate: 0h > -- This message was sent by Atlassian Jira (v8.20.1#820001)