[ 
https://issues.apache.org/jira/browse/HUDI-2029?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17378362#comment-17378362
 ] 

ASF GitHub Bot commented on HUDI-2029:
--------------------------------------

rmahindra123 commented on a change in pull request #3128:
URL: https://github.com/apache/hudi/pull/3128#discussion_r667259394



##########
File path: 
hudi-common/src/test/java/org/apache/hudi/common/util/collection/TestBitCaskDiskMap.java
##########
@@ -66,27 +68,33 @@ public void setup() {
     initPath();
   }
 
-  @Test
-  public void testSimpleInsert() throws IOException, URISyntaxException {
-    BitCaskDiskMap records = new BitCaskDiskMap<>(basePath);
+  @ParameterizedTest
+  @ValueSource(booleans = {false, true})
+  public void testSimpleInsert(boolean isCompressionEnabled) throws 
IOException, URISyntaxException {
+    BitCaskDiskMap records = new BitCaskDiskMap<>(basePath, 
isCompressionEnabled);
     List<IndexedRecord> iRecords = SchemaTestUtil.generateHoodieTestRecords(0, 
100);
-    ((GenericRecord) 
iRecords.get(0)).get(HoodieRecord.COMMIT_TIME_METADATA_FIELD).toString();
     List<String> recordKeys = SpillableMapTestUtils.upsertRecords(iRecords, 
records);
 
+    Map<String, IndexedRecord> originalRecords = iRecords.stream()
+        .collect(Collectors.toMap(k -> ((GenericRecord) 
k).get(HoodieRecord.RECORD_KEY_METADATA_FIELD).toString(), v -> v));
+
     // make sure records have spilled to disk
     assertTrue(records.sizeOfFileOnDiskInBytes() > 0);
     Iterator<HoodieRecord<? extends HoodieRecordPayload>> itr = 
records.iterator();
-    List<HoodieRecord> oRecords = new ArrayList<>();
     while (itr.hasNext()) {
       HoodieRecord<? extends HoodieRecordPayload> rec = itr.next();
-      oRecords.add(rec);
       assert recordKeys.contains(rec.getRecordKey());
+      IndexedRecord originalRecord = originalRecords.get(rec.getRecordKey());
+      HoodieAvroPayload payload = (HoodieAvroPayload) rec.getData();
+      Option<IndexedRecord> value = 
payload.getInsertValue(HoodieAvroUtils.addMetadataFields(getSimpleSchema()));
+      assertEquals(originalRecord, value.get());

Review comment:
       Added testing for value, that should test compression/decompression




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


> Implement compression for DiskBasedMap in Spillable Map
> -------------------------------------------------------
>
>                 Key: HUDI-2029
>                 URL: https://issues.apache.org/jira/browse/HUDI-2029
>             Project: Apache Hudi
>          Issue Type: Improvement
>          Components: Performance
>            Reporter: Rajesh Mahindra
>            Assignee: Rajesh Mahindra
>            Priority: Major
>              Labels: pull-request-available
>
> Implement compression for DiskBasedMap in Spillable MapĀ 
> Without compression, DiskBasedMap is causing more spilling to disk than 
> RockDb.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to