JingsongLi commented on code in PR #1372:
URL: https://github.com/apache/incubator-paimon/pull/1372#discussion_r1233878158


##########
paimon-core/src/main/java/org/apache/paimon/table/source/snapshot/SnapshotReaderImpl.java:
##########
@@ -278,29 +278,17 @@ public static List<DataSplit> generateSplits(
             Map<Integer, List<DataFileMeta>> buckets = entry.getValue();
             for (Map.Entry<Integer, List<DataFileMeta>> bucketEntry : 
buckets.entrySet()) {
                 int bucket = bucketEntry.getKey();
-                if (isIncremental) {
-                    // Don't split when incremental

Review Comment:
   We don't need to change here.
   It has little to do with performance



##########
paimon-core/src/main/java/org/apache/paimon/table/source/AppendOnlySplitGenerator.java:
##########
@@ -45,4 +49,9 @@ public List<List<DataFileMeta>> split(List<DataFileMeta> 
input) {
         Function<DataFileMeta, Long> weightFunc = file -> 
Math.max(file.fileSize(), openFileCost);
         return BinPacking.packForOrdered(files, weightFunc, targetSplitSize);
     }
+
+    @Override
+    public List<List<DataFileMeta>> split(List<DataFileMeta> files, boolean 
increment) {
+        return increment && !splitIncrement ? Collections.singletonList(files) 
: split(files);

Review Comment:
   It is OK for return one by one for bucket unaware mode.



##########
paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/source/assigners/AbstractAssignmentGenerator.java:
##########
@@ -0,0 +1,85 @@
+/*
+ * 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.flink.source.assigners;
+
+import org.apache.paimon.flink.source.FileStoreSourceSplit;
+import org.apache.paimon.table.source.DataSplit;
+
+import org.apache.flink.api.connector.source.SplitEnumeratorContext;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * Abstract for {@link AwareBucketAssignmentGenerator} and {@link 
UnawareBucketAssignmentGenerator}.
+ */
+public abstract class AbstractAssignmentGenerator implements 
AssignmentGenerator {

Review Comment:
   If this is the only method here, I think it's better to return to the 
previous if else.



##########
paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/source/assigners/AbstractAssignmentGenerator.java:
##########
@@ -0,0 +1,85 @@
+/*
+ * 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.flink.source.assigners;
+
+import org.apache.paimon.flink.source.FileStoreSourceSplit;
+import org.apache.paimon.table.source.DataSplit;
+
+import org.apache.flink.api.connector.source.SplitEnumeratorContext;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * Abstract for {@link AwareBucketAssignmentGenerator} and {@link 
UnawareBucketAssignmentGenerator}.
+ */
+public abstract class AbstractAssignmentGenerator implements 
AssignmentGenerator {

Review Comment:
   So why there are so many implementations here?
   Our abstraction purpose is to draw out the different



-- 
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]

Reply via email to