danielcweeks commented on code in PR #9782:
URL: https://github.com/apache/iceberg/pull/9782#discussion_r1548945175


##########
core/src/main/java/org/apache/iceberg/rest/PaginatedList.java:
##########
@@ -0,0 +1,269 @@
+/*
+ * 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.rest;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import java.util.ListIterator;
+import java.util.Map;
+import java.util.Spliterator;
+import java.util.Spliterators;
+import java.util.function.Supplier;
+import org.apache.iceberg.catalog.Namespace;
+import org.apache.iceberg.exceptions.ValidationException;
+import org.apache.iceberg.relocated.com.google.common.collect.Lists;
+import org.apache.iceberg.relocated.com.google.common.collect.Maps;
+import org.apache.iceberg.rest.responses.ListNamespacesResponse;
+import org.apache.iceberg.rest.responses.ListTablesResponse;
+import org.apache.iceberg.rest.responses.Route;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class PaginatedList<T> implements List<T> {

Review Comment:
   To clarify my comment, I think there are really two issues:
   
   1) The current implementation does not properly adhere to the List 
behaviors.  The dynamodb example that's referenced will eagerly fetch if 
certain methods are called, which is necessary to get the correct behavior out 
of the List interface.  
   
   2) The second issue is more about the utility of a lazy pagination since it 
seems the original motivation is more to address server side limitations (like 
Glue's 100 results per request limit) as opposed to a client side memory 
limitation.  While you might be able to optimize something like the `SHOW 
TABLES LIKE` command client-side, we haven't see the client-side as the 
limiting factor.



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