liurenjie1024 commented on code in PR #512:
URL: https://github.com/apache/iceberg-rust/pull/512#discussion_r1720891166


##########
crates/iceberg/src/io/object_cache.rs:
##########
@@ -0,0 +1,161 @@
+// 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.
+
+use std::sync::Arc;
+
+use crate::io::FileIO;
+use crate::spec::{
+    FormatVersion, Manifest, ManifestFile, ManifestList, SchemaId, 
SnapshotRef, TableMetadataRef,
+};
+use crate::{Error, ErrorKind, Result};
+
+const DEFAULT_CACHE_SIZE_BYTES: u64 = 32 * 1024 * 1024; // 32MB
+
+#[derive(Clone, Debug)]
+pub(crate) enum CachedItem {
+    ManifestList(Arc<ManifestList>),
+    Manifest(Arc<Manifest>),
+}
+
+#[derive(Clone, Debug, Hash, Eq, PartialEq)]
+pub(crate) enum CachedObjectKey {
+    ManifestList((String, FormatVersion, SchemaId)),

Review Comment:
   I did some test and found that when we upgrade table format version, or 
alter table schema, the java version will create new snapshot, but not updating 
manifest list. I think this is a bug and java implementation is not strictly 
followig spec. For example, when we upgrade table format version from v1 to v2, 
we are expecting manifest list file is also v2, but it's still v1, and we can't 
parse it using v2 parser. Java's implementation doesn't strictly require this. 
Similar things happen to schema evolution. For example, if we remove a column, 
and the `partition_type` will return an error.
   
   Thanks for this explaination, I agree that we should keep this as a 
workaround for the potential bug.



-- 
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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to