danny0405 commented on code in PR #12430:
URL: https://github.com/apache/hudi/pull/12430#discussion_r1889512873


##########
hudi-common/src/test/java/org/apache/hudi/common/table/read/TestHoodieFileGroupReaderBase.java:
##########
@@ -157,6 +168,65 @@ public void 
testReadLogFilesOnlyInMergeOnReadTable(RecordMergeMode recordMergeMo
     }
   }
 
+  @ParameterizedTest
+  @EnumSource(value = ExternalSpillableMap.DiskMapType.class)
+  public void testSpillableMapUsage(ExternalSpillableMap.DiskMapType 
diskMapType) throws Exception {
+    Map<String, String> writeConfigs = new 
HashMap<>(getCommonConfigs(RecordMergeMode.COMMIT_TIME_ORDERING));
+    Option<Schema.Type> orderingFieldType = Option.of(Schema.Type.STRING);
+    try (HoodieTestDataGenerator dataGen = new 
HoodieTestDataGenerator(0xDEEF)) {
+      commitToTable(dataGen.generateInserts("001", 100), INSERT.value(), 
writeConfigs);
+      String baseMapPath = Files.createTempDirectory(null).toString();
+      HoodieTableMetaClient metaClient = 
HoodieTestUtils.createMetaClient(getStorageConf(), getBasePath());
+      Schema avroSchema = new 
TableSchemaResolver(metaClient).getTableAvroSchema();
+      FileSlice fileSlice = getFileSliceToRead(getStorageConf(), 
getBasePath(), metaClient, dataGen.getPartitionPaths(), true, 0);
+      List<T> records = readRecordsFromFileGroup(getStorageConf(), 
getBasePath(), metaClient,  fileSlice,
+          avroSchema, RecordMergeMode.COMMIT_TIME_ORDERING, false);
+      HoodieReaderContext<T> readerContext = 
getHoodieReaderContext(getBasePath(), avroSchema, getStorageConf());
+      Comparable castedOrderingField = readerContext.castValue(100, 
Schema.Type.STRING);
+      for (Boolean isCompressionEnabled : new boolean[] {true, false}) {
+        try (ExternalSpillableMap<Serializable, Pair<Option<T>, Map<String, 
Object>>> spillableMap =

Review Comment:
   do we force spill for the map already, the map has an internal hash map 
cache itself though.



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