alexeykudinkin commented on code in PR #5773:
URL: https://github.com/apache/hudi/pull/5773#discussion_r890640414
##########
hudi-client/hudi-client-common/src/test/java/org/apache/hudi/io/storage/TestHoodieHFileReaderWriter.java:
##########
@@ -316,15 +317,20 @@ public void testReaderGetRecordIteratorByKeyPrefixes()
throws Exception {
assertEquals(expectedKey50and0s, recordsByPrefix);
// filter for "key1" and "key0" : entries from 'key10 to key19' and 'key00
to key09' should be matched.
- List<GenericRecord> expectedKey1sand0s = expectedKey1s;
- expectedKey1sand0s.addAll(allRecords.stream()
- .filter(entry -> (entry.get("_row_key").toString()).contains("key0"))
- .collect(Collectors.toList()));
+ List<GenericRecord> expectedKey1sand0s = allRecords.stream()
+ .filter(entry -> (entry.get("_row_key").toString()).contains("key1")
|| (entry.get("_row_key").toString()).contains("key0"))
+ .collect(Collectors.toList());
iterator =
hfileReader.getRecordsByKeyPrefixIterator(Arrays.asList("key1",
"key0"), avroSchema);
recordsByPrefix =
StreamSupport.stream(Spliterators.spliteratorUnknownSize(iterator,
Spliterator.ORDERED), false)
.collect(Collectors.toList());
+ Collections.sort(recordsByPrefix, new Comparator<GenericRecord>() {
Review Comment:
But they should be sorted since they are sorted in HFile and prefixes are
sorted internally, right?
--
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]