tsreaper commented on code in PR #833:
URL: https://github.com/apache/incubator-paimon/pull/833#discussion_r1177339181
##########
paimon-core/src/test/java/org/apache/paimon/mergetree/compact/CombiningRecordReaderTestBase.java:
##########
@@ -75,6 +81,11 @@ protected List<List<ReusingTestData>> generateRandomData() {
}
protected void runTest(List<List<ReusingTestData>> readersData) throws
IOException {
+ runTest(readersData, CoreOptions.SORT_ENGINE.defaultValue());
+ }
Review Comment:
Move this to `ConcatRecordReaderTest`.
##########
paimon-core/src/main/java/org/apache/paimon/mergetree/MergeTreeReaders.java:
##########
@@ -46,6 +49,23 @@ public static RecordReader<KeyValue> readerForMergeTree(
Comparator<InternalRow> userKeyComparator,
MergeFunction<KeyValue> mergeFunction)
throws IOException {
+ return readerForMergeTree(
+ sections,
+ dropDelete,
+ readerFactory,
+ userKeyComparator,
+ mergeFunction,
+ SORT_ENGINE.defaultValue());
+ }
Review Comment:
Remove this method. Make `MergeTreeTest` a parameterized test which uses
both `loser-tree` and `min-heap`.
##########
paimon-core/src/main/java/org/apache/paimon/mergetree/compact/SortMergeReader.java:
##########
@@ -38,168 +34,28 @@
*
* <p>NOTE: {@link KeyValue}s from the same {@link RecordReader} must not
contain the same key.
*/
-public class SortMergeReader<T> implements RecordReader<T> {
-
- private final List<RecordReader<KeyValue>> nextBatchReaders;
- private final Comparator<InternalRow> userKeyComparator;
- private final MergeFunctionWrapper<T> mergeFunctionWrapper;
+public abstract class SortMergeReader<T> implements RecordReader<T> {
- private final PriorityQueue<Element> minHeap;
- private final List<Element> polled;
+ protected final MergeFunctionWrapper<T> mergeFunctionWrapper;
Review Comment:
It seems strange to me that an abstract class only contains 1 member and
does not provide common methods. Maybe make this an interface?
--
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]