openinx commented on a change in pull request #1348:
URL: https://github.com/apache/iceberg/pull/1348#discussion_r482693653



##########
File path: flink/src/test/java/org/apache/iceberg/flink/SimpleDataUtil.java
##########
@@ -126,12 +126,16 @@ public static void assertTableRows(String tablePath, 
List<RowData> expected) thr
     assertTableRecords(tablePath, expectedRecords);
   }
 
-  public static void assertTableRecords(String tablePath, List<Record> 
expected) throws IOException {
-    Preconditions.checkArgument(expected != null, "expected records shouldn't 
be null");
-    Table newTable = new HadoopTables().load(tablePath);
-    try (CloseableIterable<Record> iterable = 
IcebergGenerics.read(newTable).build()) {
+  public static void assertTableRecords(Table table, List<Record> expected) 
throws IOException {
+    table.refresh();

Review comment:
       Since we don't support to scan table by flink sql,   so we have to read 
records from iceberg table by iceberg Java API in unit tests.  In this 
[test](https://github.com/apache/iceberg/pull/1348/files#diff-6fc1fa50af5a93944270e7dd4c0ea393R98),
  we get the `icebergTable` instance firstly, then the following test methods 
will commit the iceberg table by flink sql,  the `icebergTable` need a fresh to 
catch the latest changes.




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