yanghua commented on a change in pull request #1115: [HUDI-392] Introduce 
DIstributedTestDataSource to generate test data
URL: https://github.com/apache/incubator-hudi/pull/1115#discussion_r361101497
 
 

 ##########
 File path: 
hudi-test-suite/src/main/java/org/apache/hudi/testsuite/generator/DeltaGenerator.java
 ##########
 @@ -108,6 +114,17 @@ public DeltaGenerator(DeltaConfig deltaOutputConfig, 
JavaSparkContext jsc, Spark
     return inputBatch;
   }
 
+  public JavaRDD<GenericRecord> generateUpsertsWithDistributedSource(Config 
operation) {
 
 Review comment:
   I have debugged the call chain of the relevant methods. 
   
   The key chain lists below:
   
   ```
   DistributedTestDataSource#fetchNext
     DistributedTestDataSource#fetchNewData
       DistributedTestDataSource#fetchNextBatch
   ```
   
   In `DistributedTestDataSource#fetchNextBatch`, it will calculate the number 
of insert and update records. Core logic:
   
   ```
   int numExistingKeys = dataGenerator.getNumExistingKeys();
   
   int numUpdates = Math.min(numExistingKeys, sourceLimit / 2);
   int numInserts = sourceLimit - numUpdates;
   ```
   
   The `sourceLimit` variable is specified by the outside (here is 10000000). 
However, about `numExistingKeys` variable, it is always `0`. It can only be 
changed after calling some methods in `HoodieTestDataGenerator` to generate 
insert records. In our scene, these methods have never been invoked. So here:
   
   ```
   numUpdates = 0;
   numInserts = sourceLimit;
   ```
   

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


With regards,
Apache Git Services

Reply via email to