rdblue commented on code in PR #5443:
URL: https://github.com/apache/iceberg/pull/5443#discussion_r939696680


##########
core/src/test/java/org/apache/iceberg/TestMetadataTableFilters.java:
##########
@@ -153,20 +160,46 @@ private boolean isAggFileTable(MetadataTableType 
tableType) {
     return aggFileTables.contains(tableType);
   }
 
+  private String partitionColumn(String colName) {
+    switch (type) {
+      case FILES:
+      case DATA_FILES:
+      case DELETE_FILES:
+      case ALL_DATA_FILES:
+      case ALL_DELETE_FILES:
+      case ALL_FILES:
+        return String.format("partition.%s", colName);
+      case ENTRIES:
+      case ALL_ENTRIES:
+        return String.format("data_file.partition.%s", colName);
+      default:
+        throw new IllegalArgumentException("Unsupported metadata table type:" 
+ type);
+    }
+  }
+
+  /** @return a basic expression that always evaluates to true, to test AND 
logic */
+  private Expression dummyExpression() {
+    switch (type) {
+      case FILES:
+      case DATA_FILES:
+      case DELETE_FILES:
+      case ALL_DATA_FILES:
+      case ALL_DELETE_FILES:
+      case ALL_FILES:
+        return Expressions.greaterThan("record_count", 0);
+      case ENTRIES:
+      case ALL_ENTRIES:
+        return Expressions.greaterThan("data_file.record_count", 0);
+      default:
+        throw new IllegalArgumentException("Unsupported metadata table type:" 
+ type);
+    }
+  }
+
   @Test
   public void testNoFilter() {
     Table metadataTable = createMetadataTable();
-    Types.StructType expected =
-        new Schema(
-                required(
-                    102,
-                    "partition",
-                    Types.StructType.of(optional(1000, "data_bucket", 
Types.IntegerType.get())),
-                    "Partition data tuple, schema based on the partition 
spec"))
-            .asStruct();
-
-    TableScan scan = metadataTable.newScan().select("partition.data_bucket");
-    Assert.assertEquals(expected, scan.schema().asStruct());
+
+    TableScan scan = 
metadataTable.newScan().select(partitionColumn("data_bucket"));

Review Comment:
   Why remove the assertion? Is it not useful?



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

Reply via email to