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


##########
core/src/test/java/org/apache/iceberg/rest/TestRESTViewCatalog.java:
##########
@@ -144,6 +151,39 @@ public void closeCatalog() throws Exception {
     }
   }
 
+  @Test
+  public void testPaginationForListViews() {
+    RESTCatalogAdapter adapter = Mockito.spy(new 
RESTCatalogAdapter(backendCatalog));
+    RESTCatalog catalog =
+        new RESTCatalog(SessionCatalog.SessionContext.createEmpty(), (config) 
-> adapter);
+    catalog.initialize("test", 
ImmutableMap.of(RESTSessionCatalog.REST_PAGE_SIZE, "10"));
+
+    int numberOfItems = 100;
+    String namespaceName = "newdb";
+    String tableName = "newtable";
+    String viewName = "newview";
+
+    TableIdentifier tableIdentifier = TableIdentifier.of(namespaceName, 
tableName);
+
+    // create initial namespace and table
+    catalog().createNamespace(tableIdentifier.namespace());
+    tableCatalog().buildTable(tableIdentifier, SCHEMA).create();
+
+    // create several views under namespace, based off a table for listing and 
verify
+    for (int i = 0; i < numberOfItems; i++) {
+      TableIdentifier viewIndentifier = TableIdentifier.of(namespaceName, 
viewName + i);
+      catalog
+          .buildView(viewIndentifier)
+          .withSchema(SCHEMA)
+          .withDefaultNamespace(viewIndentifier.namespace())
+          .withQuery("spark", "select * from " + namespaceName + "." + 
tableName)
+          .create();
+    }
+
+    List<TableIdentifier> views = 
catalog.listViews(Namespace.of(namespaceName));
+    assertThat(views.size()).isEqualTo(numberOfItems);

Review Comment:
   same as previously mentioned



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