rdblue commented on code in PR #10253:
URL: https://github.com/apache/iceberg/pull/10253#discussion_r1876380842
##########
core/src/main/java/org/apache/iceberg/view/ViewUtil.java:
##########
@@ -18,12 +18,34 @@
*/
package org.apache.iceberg.view;
+import java.util.List;
+import java.util.concurrent.atomic.AtomicInteger;
+import org.apache.iceberg.Schema;
import org.apache.iceberg.catalog.TableIdentifier;
+import org.apache.iceberg.types.TypeUtil;
public class ViewUtil {
private ViewUtil() {}
public static String fullViewName(String catalog, TableIdentifier ident) {
return catalog + "." + ident;
}
+
+ public static Schema assignFreshIds(ViewMetadata base, Schema newSchema) {
+ return TypeUtil.assignFreshIds(
+ newSchema,
+ base.schema(),
+ new AtomicInteger(highestFieldId(base.schemas()))::incrementAndGet);
+ }
+
+ public static int maxVersionId(ViewMetadata metadata) {
Review Comment:
This method has the same issue. Instead of passing `ViewMetadata`, it should
accept `Collection<ViewVersion>`.
--
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]