Skip to content

Commit 693ee8e

Browse files
committed
fix
1 parent 4f2400c commit 693ee8e

File tree

2 files changed

+56
-13
lines changed

2 files changed

+56
-13
lines changed

paimon-core/src/test/java/org/apache/paimon/mergetree/compact/LookupChangelogMergeFunctionWrapperTest.java

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -547,17 +547,4 @@ public void testKeepLowestHighLevel() {
547547
kv = result.result();
548548
assertThat(kv.value().getInt(0)).isEqualTo(3);
549549
}
550-
551-
@Test
552-
public void testKeepLowestHighLevelLookupFunction() {
553-
LookupMergeFunction function =
554-
(LookupMergeFunction)
555-
LookupMergeFunction.wrap(DeduplicateMergeFunction.factory()).create();
556-
function.reset();
557-
function.add(new KeyValue().replace(row(1), 1, INSERT, row(2)).setLevel(1));
558-
function.add(new KeyValue().replace(row(1), 1, INSERT, row(1)).setLevel(2));
559-
KeyValue kv = function.getResult();
560-
assertThat(kv).isNotNull();
561-
assertThat(kv.value().getInt(0)).isEqualTo(2);
562-
}
563550
}
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
package org.apache.paimon.mergetree.compact;
20+
21+
import org.apache.paimon.KeyValue;
22+
23+
import org.junit.jupiter.api.Test;
24+
25+
import static org.apache.paimon.io.DataFileTestUtils.row;
26+
import static org.apache.paimon.types.RowKind.INSERT;
27+
import static org.assertj.core.api.Assertions.assertThat;
28+
29+
class LookupMergeFunctionTest {
30+
31+
@Test
32+
public void testKeepLowestHighLevel() {
33+
LookupMergeFunction function =
34+
(LookupMergeFunction)
35+
LookupMergeFunction.wrap(DeduplicateMergeFunction.factory()).create();
36+
function.reset();
37+
function.add(new KeyValue().replace(row(1), 1, INSERT, row(2)).setLevel(1));
38+
function.add(new KeyValue().replace(row(1), 1, INSERT, row(1)).setLevel(2));
39+
KeyValue kv = function.getResult();
40+
assertThat(kv).isNotNull();
41+
assertThat(kv.value().getInt(0)).isEqualTo(2);
42+
}
43+
44+
@Test
45+
public void testLevelNegative() {
46+
LookupMergeFunction function =
47+
(LookupMergeFunction)
48+
LookupMergeFunction.wrap(DeduplicateMergeFunction.factory()).create();
49+
function.reset();
50+
function.add(new KeyValue().replace(row(1), 1, INSERT, row(2)).setLevel(-1));
51+
function.add(new KeyValue().replace(row(1), 1, INSERT, row(1)).setLevel(-1));
52+
KeyValue kv = function.getResult();
53+
assertThat(kv).isNotNull();
54+
assertThat(kv.value().getInt(0)).isEqualTo(1);
55+
}
56+
}

0 commit comments

Comments
 (0)