SteNicholas commented on a change in pull request #2111: URL: https://github.com/apache/hudi/pull/2111#discussion_r501728945
########## File path: hudi-client/hudi-spark-client/src/test/java/org/apache/hudi/client/TestHoodieClientOnCopyOnWriteStorage.java ########## @@ -743,47 +743,37 @@ public void testSmallInsertHandlingForUpserts() throws Exception { */ @Test public void testSmallInsertHandlingForInserts() throws Exception { - final String testPartitionPath = "2016/09/26"; final int insertSplitLimit = 100; // setup the small file handling params HoodieWriteConfig config = getSmallInsertWriteConfig(insertSplitLimit); // hold upto 200 records max dataGen = new HoodieTestDataGenerator(new String[] {testPartitionPath}); SparkRDDWriteClient client = getHoodieWriteClient(config, false); - // Inserts => will write file1 String commitTime1 = "001"; client.startCommitWithTime(commitTime1); List<HoodieRecord> inserts1 = dataGen.generateInserts(commitTime1, insertSplitLimit); // this writes ~500kb Set<String> keys1 = recordsToRecordKeySet(inserts1); JavaRDD<HoodieRecord> insertRecordsRDD1 = jsc.parallelize(inserts1, 1); List<WriteStatus> statuses = client.insert(insertRecordsRDD1, commitTime1).collect(); - assertNoWriteErrors(statuses); - assertPartitionMetadata(new String[] {testPartitionPath}, fs); - + assertPartitionMetadata(new String[]{testPartitionPath}, fs); assertEquals(1, statuses.size(), "Just 1 file needs to be added."); - String file1 = statuses.get(0).getFileId(); assertEquals(100, readRowKeysFromParquet(hadoopConf, new Path(basePath, statuses.get(0).getStat().getPath())) .size(), "file should contain 100 records"); - // Second, set of Inserts should just expand file1 String commitTime2 = "002"; client.startCommitWithTime(commitTime2); List<HoodieRecord> inserts2 = dataGen.generateInserts(commitTime2, 40); Set<String> keys2 = recordsToRecordKeySet(inserts2); JavaRDD<HoodieRecord> insertRecordsRDD2 = jsc.parallelize(inserts2, 1); statuses = client.insert(insertRecordsRDD2, commitTime2).collect(); assertNoWriteErrors(statuses); - - assertEquals(1, statuses.size(), "Just 1 file needs to be updated."); - assertEquals(file1, statuses.get(0).getFileId(), "Existing file should be expanded"); - assertEquals(commitTime1, statuses.get(0).getStat().getPrevCommit(), "Existing file should be expanded"); Review comment: @leesf These asserts makes no sense, because statuses.get(0).getFileId() could be file1+"-0" and statuses.get(0).getStat().getPrevCommit() could be null. ---------------------------------------------------------------- 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: us...@infra.apache.org