This is an automated email from the ASF dual-hosted git repository.

lzljs3620320 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink-table-store.git


The following commit(s) were added to refs/heads/master by this push:
     new 6dbf047  [hotfix] Fix unstable test FileStoreReadTest#testKeyProjection
6dbf047 is described below

commit 6dbf0476cc0b83b86717478d62141ebdfeece9b3
Author: tsreaper <[email protected]>
AuthorDate: Wed Mar 23 21:00:34 2022 +0800

    [hotfix] Fix unstable test FileStoreReadTest#testKeyProjection
    
    This closes #59
---
 .../apache/flink/table/store/file/operation/FileStoreReadTest.java    | 4 ++++
 1 file changed, 4 insertions(+)

diff --git 
a/flink-table-store-core/src/test/java/org/apache/flink/table/store/file/operation/FileStoreReadTest.java
 
b/flink-table-store-core/src/test/java/org/apache/flink/table/store/file/operation/FileStoreReadTest.java
index 0163292..b691d85 100644
--- 
a/flink-table-store-core/src/test/java/org/apache/flink/table/store/file/operation/FileStoreReadTest.java
+++ 
b/flink-table-store-core/src/test/java/org/apache/flink/table/store/file/operation/FileStoreReadTest.java
@@ -77,6 +77,7 @@ public class FileStoreReadTest {
             int b = random.nextInt(3);
             int c = random.nextInt(3);
             long delta = random.nextLong(21) - 10;
+            // count number of occurrence of (b, a)
             expected.compute(b * 10 + a, (k, v) -> v == null ? delta : v + 
delta);
             data.add(
                     new KeyValue()
@@ -86,6 +87,8 @@ public class FileStoreReadTest {
                                     ValueKind.ADD,
                                     GenericRowData.of(delta)));
         }
+        // remove zero occurrence, it might be merged and discarded by the 
merge tree
+        expected.entrySet().removeIf(e -> e.getValue() == 0);
 
         RowType partitionType =
                 RowType.of(new LogicalType[] {new IntType(false)}, new 
String[] {"c"});
@@ -123,6 +126,7 @@ public class FileStoreReadTest {
             long delta = kv.value().getLong(0);
             actual.compute(key, (k, v) -> v == null ? delta : v + delta);
         }
+        actual.entrySet().removeIf(e -> e.getValue() == 0);
         assertThat(actual).isEqualTo(expected);
     }
 

Reply via email to