jackye1995 commented on a change in pull request #2096:
URL: https://github.com/apache/iceberg/pull/2096#discussion_r559023819



##########
File path: core/src/main/java/org/apache/iceberg/TableMetadataParser.java
##########
@@ -242,6 +255,7 @@ public static TableMetadata read(FileIO io, InputFile file) 
{
     }
   }
 
+  @SuppressWarnings("checkstyle:CyclomaticComplexity")

Review comment:
       I remember this also shows up when adding primary key #2010 , I think we 
should probably find some way to refactor the code a bit.

##########
File path: api/src/main/java/org/apache/iceberg/VersionedSchema.java
##########
@@ -0,0 +1,68 @@
+/*
+ * 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;
+
+import java.io.Serializable;
+import java.util.Objects;
+
+/**
+ * A wrapper around Schema to include its schema ID
+ */
+public class VersionedSchema implements Serializable {

Review comment:
       The biggest question I have for this PR is whether we should have this 
wrapped class for adding schema ID, or we should just add schema ID to the 
`Schema` class itself, maybe as an optional `Integer`. Because Iceberg have its 
own jackson parser for serdes, it is not hard to ignore the `schemaId` field or 
set a default for it for backwards compatibility. What is the benefit of this 
`VersionedSchema` approach?
   




----------------------------------------------------------------
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]

Reply via email to