hudi-agent commented on code in PR #19746:
URL: https://github.com/apache/hudi/pull/19746#discussion_r3865648684


##########
hudi-utilities/src/test/java/org/apache/hudi/utilities/deltastreamer/TestSparkSampleWritesUtils.java:
##########
@@ -92,17 +96,20 @@ public void 
skipOverwriteRecordSizeEstimateWhenTimelineNonEmpty() throws Excepti
     assertEquals(originalRecordSize, 
originalWriteConfig.getCopyOnWriteRecordSizeEstimate(), "Original record size 
estimate should not be changed.");
   }
 
-  @Test
-  void overwriteRecordSizeEstimateForEmptyTable() throws IOException {
+  @ParameterizedTest
+  @EnumSource(value = HoodieTableVersion.class, names = {"SIX", "NINE"})
+  void overwriteRecordSizeEstimateForEmptyTable(HoodieTableVersion 
tableVersion) throws IOException {
     int originalRecordSize = 100;
     TypedProperties props = new TypedProperties();
     props.put(HoodieStreamerConfig.SAMPLE_WRITES_ENABLED.key(), "true");
     props.put(HoodieCompactionConfig.COPY_ON_WRITE_RECORD_SIZE_ESTIMATE.key(), 
String.valueOf(originalRecordSize));
+    props.put(HoodieWriteConfig.WRITE_TABLE_VERSION.key(), 
String.valueOf(tableVersion.versionCode()));
     HoodieWriteConfig originalWriteConfig = HoodieWriteConfig.newBuilder()
         .withProperties(props)
         .forTable("foo")
         .withPath(basePath())
         .withSchema(HoodieTestDataGenerator.TRIP_EXAMPLE_SCHEMA)
+        .withWriteTableVersion(tableVersion.versionCode())
         .build();

Review Comment:
   🤖 nit: `tableVersion` appears to be set twice — once via 
`props.put(HoodieWriteConfig.WRITE_TABLE_VERSION.key(), ...)` and again via 
`.withWriteTableVersion(tableVersion.versionCode())`. Could you drop the 
redundant one (whichever `HoodieWriteConfig.newBuilder()` actually honours) so 
readers don't have to wonder if both are intentional?
   
   <sub><i>⚠️ AI-generated; verify before applying. React 👍/👎 to flag 
quality.</i></sub>



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

Reply via email to