findepi commented on code in PR #4741: URL: https://github.com/apache/iceberg/pull/4741#discussion_r896569192
########## api/src/main/java/org/apache/iceberg/UpdateTableStatistics.java: ########## @@ -0,0 +1,44 @@ +/* + * 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; + +/** + * API for adding or removing statistics files from a table. + */ +public interface UpdateTableStatistics extends PendingUpdate<Snapshot> { + /** + * Delete a statistics file path from the underlying table. + * <p> + * To remove a statistics file from the table, this path must equal a path in the table's metadata. Paths + * that are different but equivalent will not be removed. For example, file:/path/file.avro is + * equivalent to file:///path/file.avro, but would not remove the latter path from the table. + * + * @param path a fully-qualified file path to remove from the table + * @return this for method chaining + */ + UpdateTableStatistics deleteStatisticsFile(CharSequence path); Review Comment: > 1. There's nothing preventing the stats from being in the same file. Even if a writer doesn't understand some of the blobs, it can still preserve them in the same file where it is adding new ones. There isn't a need for separate files. agreed > 2\. Most of the time, writers will understand the blobs produced by other writers. The aim is to standardize the stats and index content. Situations where Ryan's stats and Piotr's stats are completely different should be rare. they can be of different types: one can be a sketch, the other a bloom filter, or a histogram > While it is more work for the writer, this ensures that stats are maintained. Tracking multiple files makes it so we need to worry about pruning those files. agreed > One problem with this is that I don't think we are tracking freshness metadata in the Puffin file BlobMetadata, only for the file itself, Yes. > I think we should add snapshot-id and sequence-number to blob metadata. we can add them as standard properties in the BlobMetadata.properties field. This would also propagate to the metadata properties we have here in the table, and thus would let the reader determine whether the stats are "fresh enough" for their needs, without reading the Puffin footer. WDYT? -- 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]
