vinothchandar commented on code in PR #13365:
URL: https://github.com/apache/hudi/pull/13365#discussion_r2153783195


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/io/BinaryCopyHandleFactory.java:
##########
@@ -0,0 +1,59 @@
+/*
+ * 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.hudi.io;
+
+import org.apache.hudi.common.engine.TaskContextSupplier;
+import org.apache.hudi.config.HoodieWriteConfig;
+import org.apache.hudi.storage.StoragePath;
+import org.apache.hudi.table.HoodieTable;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * Combine all input file paths quickly into a single large file at block 
level.
+ * Without performing extra operations like data serialization/deserialization 
or compression/decompression.
+ */
+public class BinaryCopyHandleFactory<T, I, K, O>
+    extends WriteHandleFactory<T, I, K, O> implements Serializable {
+
+  private final List<StoragePath> inputFilePaths;
+
+  public BinaryCopyHandleFactory(List<StoragePath> inputFilePaths) {
+    this.inputFilePaths = inputFilePaths;
+  }
+
+  @Override
+  public HoodieBinaryCopyHandle<T, I, K, O> create(
+      HoodieWriteConfig config,
+      String commitTime,
+      HoodieTable<T, I, K, O> hoodieTable,
+      String partitionPath,
+      String fileIdPrefix,
+      TaskContextSupplier taskContextSupplier) {
+    return new HoodieBinaryCopyHandle(
+        config,
+        commitTime,
+        partitionPath,
+        getNextFileId(fileIdPrefix),
+        hoodieTable,

Review Comment:
   rename: table



##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/io/BinaryCopyHandleFactory.java:
##########
@@ -0,0 +1,59 @@
+/*
+ * 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.hudi.io;
+
+import org.apache.hudi.common.engine.TaskContextSupplier;
+import org.apache.hudi.config.HoodieWriteConfig;
+import org.apache.hudi.storage.StoragePath;
+import org.apache.hudi.table.HoodieTable;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * Combine all input file paths quickly into a single large file at block 
level.
+ * Without performing extra operations like data serialization/deserialization 
or compression/decompression.
+ */
+public class BinaryCopyHandleFactory<T, I, K, O>

Review Comment:
   like the name "binary copy" way better..  thanks!



##########
hudi-client/hudi-spark-client/src/main/scala/org/apache/hudi/AvroConversionUtils.scala:
##########
@@ -268,4 +267,106 @@ object AvroConversionUtils {
     }
     schema
   }
+
+  /**
+   * Recursively aligns the nullable property of hoodie table schema, 
supporting nested structures
+   */
+  def alignFieldsNullability(sourceSchema: StructType, avroSchema: Schema): 
StructType = {

Review Comment:
   lets please ensure each method here has unit tests.



##########
hudi-common/src/main/java/org/apache/hudi/common/bloom/BloomFilter.java:
##########
@@ -54,4 +54,10 @@ public interface BloomFilter {
    * @return the bloom index type code.
    **/
   BloomFilterTypeCode getBloomFilterTypeCode();
+
+  /**
+   * Performs a logical OR operations with other BloomFilter.
+   * @param other
+   */
+  void or(BloomFilter other);

Review Comment:
   @zhangyue19921010 can we move them to `TestBloomFilter` or the direct UT for 
the class.



##########
hudi-common/src/main/java/org/apache/hudi/common/bloom/HoodieDynamicBoundedBloomFilter.java:
##########
@@ -125,5 +126,42 @@ private void 
extractAndSetInternalBloomFilter(DataInputStream dis) throws IOExce
     internalDynamicBloomFilter = new InternalDynamicBloomFilter();
     internalDynamicBloomFilter.readFields(dis);
   }
+
+  @Override
+  public void or(BloomFilter other) {

Review Comment:
   Same. please move them to the UT for this class. I know it's a bit scattered 
now . but change starts somewhere :)



##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/io/BinaryCopyHandleFactory.java:
##########
@@ -0,0 +1,59 @@
+/*
+ * 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.hudi.io;
+
+import org.apache.hudi.common.engine.TaskContextSupplier;
+import org.apache.hudi.config.HoodieWriteConfig;
+import org.apache.hudi.storage.StoragePath;
+import org.apache.hudi.table.HoodieTable;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * Combine all input file paths quickly into a single large file at block 
level.
+ * Without performing extra operations like data serialization/deserialization 
or compression/decompression.
+ */
+public class BinaryCopyHandleFactory<T, I, K, O>
+    extends WriteHandleFactory<T, I, K, O> implements Serializable {
+
+  private final List<StoragePath> inputFilePaths;
+
+  public BinaryCopyHandleFactory(List<StoragePath> inputFilePaths) {
+    this.inputFilePaths = inputFilePaths;
+  }
+
+  @Override
+  public HoodieBinaryCopyHandle<T, I, K, O> create(
+      HoodieWriteConfig config,
+      String commitTime,
+      HoodieTable<T, I, K, O> hoodieTable,
+      String partitionPath,
+      String fileIdPrefix,
+      TaskContextSupplier taskContextSupplier) {
+    return new HoodieBinaryCopyHandle(
+        config,
+        commitTime,

Review Comment:
   nit. rename: commitTime -> instantTime



##########
hudi-common/src/main/java/org/apache/hudi/common/bloom/InternalDynamicBloomFilter.java:
##########
@@ -210,13 +210,29 @@ public void readFields(DataInput in) throws IOException {
   /**
    * Adds a new row to <i>this</i> dynamic Bloom filter.
    */
-  private void addRow() {
+  protected void addRow() {
     InternalBloomFilter[] tmp = new InternalBloomFilter[matrix.length + 1];
     System.arraycopy(matrix, 0, tmp, 0, matrix.length);
     tmp[tmp.length - 1] = new InternalBloomFilter(vectorSize, nbHash, 
hashType);
     matrix = tmp;
   }
 
+  protected void addRows(int size) {

Review Comment:
   UT



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