This is an automated email from the ASF dual-hosted git repository.
lzljs3620320 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/paimon.git
The following commit(s) were added to refs/heads/master by this push:
new 781785fe0a [test] remove incorrect and confusing tests in
PartialUpdateMergeFunctionTest (#4882)
781785fe0a is described below
commit 781785fe0a6bb2cd5b017536dd189946ba07f172
Author: LsomeYeah <[email protected]>
AuthorDate: Fri Jan 10 19:06:57 2025 +0800
[test] remove incorrect and confusing tests in
PartialUpdateMergeFunctionTest (#4882)
---
.../compact/PartialUpdateMergeFunctionTest.java | 74 ----------------------
1 file changed, 74 deletions(-)
diff --git
a/paimon-core/src/test/java/org/apache/paimon/mergetree/compact/PartialUpdateMergeFunctionTest.java
b/paimon-core/src/test/java/org/apache/paimon/mergetree/compact/PartialUpdateMergeFunctionTest.java
index 93f634944e..529110cabc 100644
---
a/paimon-core/src/test/java/org/apache/paimon/mergetree/compact/PartialUpdateMergeFunctionTest.java
+++
b/paimon-core/src/test/java/org/apache/paimon/mergetree/compact/PartialUpdateMergeFunctionTest.java
@@ -314,80 +314,6 @@ public class PartialUpdateMergeFunctionTest {
.hasMessageContaining("is defined repeatedly by multiple
groups");
}
- @Test
- public void testAdjustProjectionRepeatProject() {
- Options options = new Options();
- options.set("fields.f4.sequence-group", "f1,f3");
- options.set("fields.f5.sequence-group", "f7");
- RowType rowType =
- RowType.of(
- DataTypes.INT(),
- DataTypes.INT(),
- DataTypes.INT(),
- DataTypes.INT(),
- DataTypes.INT(),
- DataTypes.INT(),
- DataTypes.INT(),
- DataTypes.INT());
- // the field 'f1' is projected twice
- int[][] projection = new int[][] {{1}, {1}, {3}, {7}};
- MergeFunctionFactory<KeyValue> factory =
- PartialUpdateMergeFunction.factory(options, rowType,
ImmutableList.of("f0"));
- MergeFunctionFactory.AdjustedProjection adjustedProjection =
- factory.adjustProjection(projection);
-
- validate(adjustedProjection, new int[] {1, 1, 3, 7, 4, 5}, new int[]
{0, 1, 2, 3});
-
- MergeFunction<KeyValue> func =
factory.create(adjustedProjection.pushdownProjection);
- func.reset();
- add(func, 1, 1, 1, 1, 1, 1);
- add(func, 2, 2, 6, 2, 2, 2);
- validate(func, 2, 2, 6, 2, 2, 2);
-
- // enable field updated by null
- add(func, 3, 3, null, 7, 4, null);
- validate(func, 3, 3, null, 2, 4, 2);
- }
-
- @Test
- public void testMultiSequenceFieldsAdjustProjectionRepeatProject() {
- Options options = new Options();
- options.set("fields.f2,f4.sequence-group", "f1,f3");
- options.set("fields.f5,f6.sequence-group", "f7");
- RowType rowType =
- RowType.of(
- DataTypes.INT(),
- DataTypes.INT(),
- DataTypes.INT(),
- DataTypes.INT(),
- DataTypes.INT(),
- DataTypes.INT(),
- DataTypes.INT(),
- DataTypes.INT());
- // the field 'f1' is projected twice
- int[][] projection = new int[][] {{1}, {1}, {3}, {7}};
- MergeFunctionFactory<KeyValue> factory =
- PartialUpdateMergeFunction.factory(options, rowType,
ImmutableList.of("f0"));
- MergeFunctionFactory.AdjustedProjection adjustedProjection =
- factory.adjustProjection(projection);
-
- validate(adjustedProjection, new int[] {1, 1, 3, 7, 2, 4, 5, 6}, new
int[] {0, 1, 2, 3});
-
- MergeFunction<KeyValue> func =
factory.create(adjustedProjection.pushdownProjection);
- func.reset();
- add(func, 1, 1, 1, 1, 1, 1, 1, 1);
- add(func, 2, 2, 6, 2, 2, 2, 2, 6);
- validate(func, 2, 2, 6, 2, 2, 2, 2, 6);
-
- // update first sequence group
- add(func, 3, 3, null, 7, 4, null, 1, 8);
- validate(func, 3, 3, null, 2, 4, null, 2, 6);
-
- // update second sequence group
- add(func, 5, 5, 3, 3, 3, 5, 5, 6);
- validate(func, 5, 3, null, 3, 4, null, 5, 6);
- }
-
@Test
public void testAdjustProjectionSequenceFieldsProject() {
Options options = new Options();