JingsongLi commented on code in PR #6394:
URL: https://github.com/apache/paimon/pull/6394#discussion_r2534098827
##########
paimon-core/src/main/java/org/apache/paimon/io/KeyValueFileReaderFactory.java:
##########
@@ -262,6 +300,16 @@ public KeyValueFileReaderFactory build(
DeletionVector.Factory dvFactory,
boolean projectKeys,
@Nullable List<Predicate> filters) {
+ return build(partition, bucket, dvFactory, projectKeys, filters,
null);
+ }
+
+ public KeyValueFileReaderFactory build(
+ BinaryRow partition,
+ int bucket,
+ DeletionVector.Factory dvFactory,
+ boolean projectKeys,
+ @Nullable List<Predicate> filters,
+ @Nullable DataSplit split) {
Review Comment:
In this method, the partition and bucket have already been passed, and
anther parameter split that actually affects the partition and bucket of data
files, which is very bad and affects the explanation of this method. Code
readers cannot understand where this information comes from.
##########
paimon-core/src/main/java/org/apache/paimon/table/source/ChainDataSplit.java:
##########
@@ -0,0 +1,261 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.paimon.table.source;
+
+import org.apache.paimon.data.BinaryRow;
+import org.apache.paimon.io.DataFileMeta;
+import org.apache.paimon.io.DataInputView;
+import org.apache.paimon.io.DataInputViewStreamWrapper;
+import org.apache.paimon.io.DataOutputView;
+import org.apache.paimon.io.DataOutputViewStreamWrapper;
+import org.apache.paimon.utils.Preconditions;
+import org.apache.paimon.utils.SerializationUtils;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Optional;
+import java.util.stream.Collectors;
+
+/** A specific implementation about {@link DataSplit} for chain table. */
+public class ChainDataSplit extends DataSplit {
Review Comment:
If a class extends from another class, it must fully explain all the
behaviors of its parent class, but `ChainDataSplit` is a serious conflict with
the parent class `DataSplit`. It cannot be a DataSplit.
##########
paimon-core/src/main/java/org/apache/paimon/KeyValueFileStore.java:
##########
@@ -111,7 +112,7 @@ public BucketMode bucketMode() {
@Override
public MergeFileSplitRead newRead() {
- return new MergeFileSplitRead(
+ return ScanFactory.createMergeFileSplitRead(
Review Comment:
Chain wrapping should only be in `ChainFileStoreTable`, all abstractions
should be completed within it to avoid affecting the code logic of other main
code path.
--
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]