JingsongLi commented on code in PR #4126:
URL: https://github.com/apache/paimon/pull/4126#discussion_r1752161025
##########
paimon-core/src/main/java/org/apache/paimon/utils/ChangelogDeduplicateEqualiserSupplier.java:
##########
@@ -28,18 +28,29 @@
import static org.apache.paimon.codegen.CodeGenUtils.newRecordEqualiser;
/** A {@link Supplier} that returns the equaliser for the file store value. */
-public class ValueEqualiserSupplier implements
SerializableSupplier<RecordEqualiser> {
+public class ChangelogDeduplicateEqualiserSupplier
+ implements SerializableSupplier<RecordEqualiser> {
private static final long serialVersionUID = 1L;
private final List<DataType> fieldTypes;
- public ValueEqualiserSupplier(RowType keyType) {
+ private final int[] projection;
+
Review Comment:
create a static method:
```
public static ValueEqualiserSupplier fromIgnoreFields(RowType rowType,
@nullable List<String> ignoreFields) {
........
}
```
##########
paimon-core/src/main/java/org/apache/paimon/KeyValueFileStore.java:
##########
@@ -243,4 +250,12 @@ public void pushdown(Predicate keyFilter) {
public Comparator<InternalRow> newKeyComparator() {
return keyComparatorSupplier.get();
}
+
+ private int[] getProjectionWithIgnoreFields(RowType rowType, List<String>
ignoreFields) {
Review Comment:
move these codes into `ValueEqualiserSupplier`.
##########
paimon-core/src/main/java/org/apache/paimon/KeyValueFileStore.java:
##########
@@ -93,7 +94,13 @@ public KeyValueFileStore(
this.keyValueFieldsExtractor = keyValueFieldsExtractor;
this.mfFactory = mfFactory;
this.keyComparatorSupplier = new KeyComparatorSupplier(keyType);
- this.valueEqualiserSupplier = new ValueEqualiserSupplier(valueType);
+ List<String> ignoreFields =
options.changelogRowDeduplicateIgnoreSequenceField();
+ int[] projection =
+ options.changelogRowDeduplicate() && !ignoreFields.isEmpty()
+ ? getProjectionWithIgnoreFields(valueType,
ignoreFields)
+ : null;
+ this.valueEqualiserSupplier =
Review Comment:
change this to `logDedupEqualSupplier`
##########
paimon-core/src/main/java/org/apache/paimon/utils/ChangelogDeduplicateEqualiserSupplier.java:
##########
@@ -28,18 +28,29 @@
import static org.apache.paimon.codegen.CodeGenUtils.newRecordEqualiser;
/** A {@link Supplier} that returns the equaliser for the file store value. */
-public class ValueEqualiserSupplier implements
SerializableSupplier<RecordEqualiser> {
+public class ChangelogDeduplicateEqualiserSupplier
Review Comment:
revert this. let is be `ValueEqualiserSupplier`.
--
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]