yihua commented on code in PR #13746:
URL: https://github.com/apache/hudi/pull/13746#discussion_r2298241223


##########
hudi-client/hudi-client-common/src/test/java/org/apache/hudi/io/TestHoodieCreateHandle.java:
##########
@@ -0,0 +1,450 @@
+/*
+ * 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.avro.Schema;
+import org.apache.avro.generic.GenericRecord;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
+import org.apache.hudi.client.WriteStatus;
+import org.apache.hudi.common.config.HoodieMetadataConfig;
+import org.apache.hudi.common.config.TypedProperties;
+import org.apache.hudi.common.engine.LocalTaskContextSupplier;
+import org.apache.hudi.common.engine.TaskContextSupplier;
+import org.apache.hudi.common.fs.FSUtils;
+import org.apache.hudi.common.model.HoodiePartitionMetadata;
+import org.apache.hudi.common.model.HoodieRecord;
+import org.apache.hudi.common.model.HoodieWriteStat;
+import org.apache.hudi.common.model.IOType;
+import org.apache.hudi.common.table.HoodieTableMetaClient;
+import org.apache.hudi.common.testutils.HoodieCommonTestHarness;
+import org.apache.hudi.common.util.Option;
+import org.apache.hudi.common.util.ParquetUtils;
+import org.apache.hudi.config.HoodieWriteConfig;
+import org.apache.hudi.exception.HoodieInsertException;
+import org.apache.hudi.io.storage.HoodieFileWriter;
+import org.apache.hudi.storage.StoragePath;
+import org.apache.hudi.table.HoodieTable;
+import org.apache.hudi.table.TestBaseHoodieTable;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.Arguments;
+import org.junit.jupiter.params.provider.MethodSource;
+import org.mockito.junit.jupiter.MockitoExtension;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Stream;
+
+import static 
org.apache.hudi.common.testutils.HoodieTestDataGenerator.DEFAULT_FIRST_PARTITION_PATH;
+import static 
org.apache.hudi.common.testutils.HoodieTestDataGenerator.DEFAULT_PARTITION_PATHS;
+import static 
org.apache.hudi.common.testutils.HoodieTestDataGenerator.DEFAULT_SECOND_PARTITION_PATH;
+import static 
org.apache.hudi.common.testutils.HoodieTestDataGenerator.TRIP_EXAMPLE_SCHEMA;
+import static 
org.apache.hudi.common.testutils.HoodieTestDataGenerator.TRIP_FLATTENED_SCHEMA;
+import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.doThrow;
+import static org.mockito.Mockito.spy;
+
+@ExtendWith(MockitoExtension.class)
+public class TestHoodieCreateHandle extends HoodieCommonTestHarness {
+  private static final String TEST_INSTANT_TIME = "20231201120000";
+  private static final String TEST_FILE_ID = "file-001";
+  private static final Schema TEST_SCHEMA = new 
Schema.Parser().parse(TRIP_EXAMPLE_SCHEMA);
+  private static final String TEST_PARTITION_PATH = 
DEFAULT_FIRST_PARTITION_PATH;
+
+  private HoodieWriteConfig writeConfig;
+  private TaskContextSupplier taskContextSupplier;
+  private HoodieTable hoodieTable;
+
+  @BeforeEach
+  void setUp() throws IOException {
+    initPath();
+    initMetaClient(false);
+    initTestDataGenerator();
+
+    writeConfig = HoodieWriteConfig.newBuilder()
+      .withPath(basePath)
+      .withSchema(TRIP_EXAMPLE_SCHEMA)
+      .withMarkersType("DIRECT")
+      
.withMetadataConfig(HoodieMetadataConfig.newBuilder().enable(false).build())
+      .build();
+    hoodieTable = new TestBaseHoodieTable(writeConfig, getEngineContext(), 
metaClient);
+    taskContextSupplier = new LocalTaskContextSupplier();
+  }
+
+  @AfterEach
+  void tearDown() throws Exception {
+    cleanMetaClient();
+    cleanupTestDataGenerator();
+  }
+
+  @Test
+  void testConstructorWithBasicParameters() {
+    HoodieCreateHandle createHandle = new HoodieCreateHandle(
+        writeConfig, TEST_INSTANT_TIME, hoodieTable, TEST_PARTITION_PATH,
+        TEST_FILE_ID, taskContextSupplier);
+
+    assertNotNull(createHandle);
+    assertEquals(IOType.CREATE, createHandle.getIOType());
+    assertFalse(createHandle.preserveMetadata);
+  }
+
+  @Test
+  void testConstructorWithPreserveMetadata() {
+    HoodieCreateHandle createHandle = new HoodieCreateHandle(
+        writeConfig, TEST_INSTANT_TIME, hoodieTable, TEST_PARTITION_PATH,
+        TEST_FILE_ID, taskContextSupplier, true);
+
+    assertNotNull(createHandle);
+    assertTrue(createHandle.preserveMetadata);
+  }
+
+  @Test
+  public void testConstructorWithOverriddenSchema() {
+    Schema overridenSchema = new Schema.Parser().parse(TRIP_FLATTENED_SCHEMA);
+
+    HoodieCreateHandle handleWithOverridenSchema = new HoodieCreateHandle<>(
+        writeConfig, TEST_INSTANT_TIME, hoodieTable, TEST_PARTITION_PATH,
+        TEST_FILE_ID, Option.of(overridenSchema), taskContextSupplier);
+    assertEquals(overridenSchema, handleWithOverridenSchema.writeSchema);
+  }
+
+  @Test
+  void testConstructorCreatesPartitionMetadataAndMarkerAndBaseFile() throws 
Exception {
+    HoodieCreateHandle createHandle = new HoodieCreateHandle(
+        writeConfig, TEST_INSTANT_TIME, hoodieTable, TEST_PARTITION_PATH,
+        TEST_FILE_ID, taskContextSupplier);
+    assertNotNull(createHandle);
+
+    FileSystem fs = (FileSystem) metaClient.getStorage().getFileSystem();
+
+    // Verify partition metadata file exists under the target partition
+    Path partitionPath = new Path(basePath, TEST_PARTITION_PATH);
+    validatePartitionMetaPathExistence(fs, true);
+
+    // Verify marker file exists with expected name
+    String expectedBaseFileName = getExpectedBaseFileName();
+    validateMarkerFileExistence(fs, expectedBaseFileName, true);
+
+    // Verify the base file path exists
+    Path expectedBaseFilePath = new Path(partitionPath, expectedBaseFileName);
+    assertTrue(fs.exists(expectedBaseFilePath));

Review Comment:
   Use `HoodieStorage#exists`



##########
hudi-client/hudi-client-common/src/test/java/org/apache/hudi/io/TestHoodieCreateHandle.java:
##########
@@ -0,0 +1,450 @@
+/*
+ * 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.avro.Schema;
+import org.apache.avro.generic.GenericRecord;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
+import org.apache.hudi.client.WriteStatus;
+import org.apache.hudi.common.config.HoodieMetadataConfig;
+import org.apache.hudi.common.config.TypedProperties;
+import org.apache.hudi.common.engine.LocalTaskContextSupplier;
+import org.apache.hudi.common.engine.TaskContextSupplier;
+import org.apache.hudi.common.fs.FSUtils;
+import org.apache.hudi.common.model.HoodiePartitionMetadata;
+import org.apache.hudi.common.model.HoodieRecord;
+import org.apache.hudi.common.model.HoodieWriteStat;
+import org.apache.hudi.common.model.IOType;
+import org.apache.hudi.common.table.HoodieTableMetaClient;
+import org.apache.hudi.common.testutils.HoodieCommonTestHarness;
+import org.apache.hudi.common.util.Option;
+import org.apache.hudi.common.util.ParquetUtils;
+import org.apache.hudi.config.HoodieWriteConfig;
+import org.apache.hudi.exception.HoodieInsertException;
+import org.apache.hudi.io.storage.HoodieFileWriter;
+import org.apache.hudi.storage.StoragePath;
+import org.apache.hudi.table.HoodieTable;
+import org.apache.hudi.table.TestBaseHoodieTable;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.Arguments;
+import org.junit.jupiter.params.provider.MethodSource;
+import org.mockito.junit.jupiter.MockitoExtension;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Stream;
+
+import static 
org.apache.hudi.common.testutils.HoodieTestDataGenerator.DEFAULT_FIRST_PARTITION_PATH;
+import static 
org.apache.hudi.common.testutils.HoodieTestDataGenerator.DEFAULT_PARTITION_PATHS;
+import static 
org.apache.hudi.common.testutils.HoodieTestDataGenerator.DEFAULT_SECOND_PARTITION_PATH;
+import static 
org.apache.hudi.common.testutils.HoodieTestDataGenerator.TRIP_EXAMPLE_SCHEMA;
+import static 
org.apache.hudi.common.testutils.HoodieTestDataGenerator.TRIP_FLATTENED_SCHEMA;
+import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.doThrow;
+import static org.mockito.Mockito.spy;
+
+@ExtendWith(MockitoExtension.class)
+public class TestHoodieCreateHandle extends HoodieCommonTestHarness {
+  private static final String TEST_INSTANT_TIME = "20231201120000";
+  private static final String TEST_FILE_ID = "file-001";
+  private static final Schema TEST_SCHEMA = new 
Schema.Parser().parse(TRIP_EXAMPLE_SCHEMA);
+  private static final String TEST_PARTITION_PATH = 
DEFAULT_FIRST_PARTITION_PATH;
+
+  private HoodieWriteConfig writeConfig;
+  private TaskContextSupplier taskContextSupplier;
+  private HoodieTable hoodieTable;
+
+  @BeforeEach
+  void setUp() throws IOException {
+    initPath();
+    initMetaClient(false);
+    initTestDataGenerator();
+
+    writeConfig = HoodieWriteConfig.newBuilder()
+      .withPath(basePath)
+      .withSchema(TRIP_EXAMPLE_SCHEMA)
+      .withMarkersType("DIRECT")
+      
.withMetadataConfig(HoodieMetadataConfig.newBuilder().enable(false).build())
+      .build();
+    hoodieTable = new TestBaseHoodieTable(writeConfig, getEngineContext(), 
metaClient);
+    taskContextSupplier = new LocalTaskContextSupplier();
+  }
+
+  @AfterEach
+  void tearDown() throws Exception {
+    cleanMetaClient();
+    cleanupTestDataGenerator();
+  }
+
+  @Test
+  void testConstructorWithBasicParameters() {
+    HoodieCreateHandle createHandle = new HoodieCreateHandle(
+        writeConfig, TEST_INSTANT_TIME, hoodieTable, TEST_PARTITION_PATH,
+        TEST_FILE_ID, taskContextSupplier);
+
+    assertNotNull(createHandle);
+    assertEquals(IOType.CREATE, createHandle.getIOType());
+    assertFalse(createHandle.preserveMetadata);
+  }
+
+  @Test
+  void testConstructorWithPreserveMetadata() {
+    HoodieCreateHandle createHandle = new HoodieCreateHandle(
+        writeConfig, TEST_INSTANT_TIME, hoodieTable, TEST_PARTITION_PATH,
+        TEST_FILE_ID, taskContextSupplier, true);
+
+    assertNotNull(createHandle);
+    assertTrue(createHandle.preserveMetadata);
+  }
+
+  @Test
+  public void testConstructorWithOverriddenSchema() {
+    Schema overridenSchema = new Schema.Parser().parse(TRIP_FLATTENED_SCHEMA);
+
+    HoodieCreateHandle handleWithOverridenSchema = new HoodieCreateHandle<>(
+        writeConfig, TEST_INSTANT_TIME, hoodieTable, TEST_PARTITION_PATH,
+        TEST_FILE_ID, Option.of(overridenSchema), taskContextSupplier);
+    assertEquals(overridenSchema, handleWithOverridenSchema.writeSchema);
+  }
+
+  @Test
+  void testConstructorCreatesPartitionMetadataAndMarkerAndBaseFile() throws 
Exception {
+    HoodieCreateHandle createHandle = new HoodieCreateHandle(
+        writeConfig, TEST_INSTANT_TIME, hoodieTable, TEST_PARTITION_PATH,
+        TEST_FILE_ID, taskContextSupplier);
+    assertNotNull(createHandle);
+
+    FileSystem fs = (FileSystem) metaClient.getStorage().getFileSystem();
+
+    // Verify partition metadata file exists under the target partition
+    Path partitionPath = new Path(basePath, TEST_PARTITION_PATH);

Review Comment:
   Use `StoragePath` instead of Hadoop's `Path`



##########
hudi-client/hudi-client-common/src/test/java/org/apache/hudi/io/TestHoodieCreateHandle.java:
##########
@@ -0,0 +1,450 @@
+/*
+ * 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.avro.Schema;
+import org.apache.avro.generic.GenericRecord;

Review Comment:
   Same on import ordering and grouping.



##########
hudi-client/hudi-client-common/src/test/java/org/apache/hudi/io/TestHoodieCreateHandle.java:
##########
@@ -0,0 +1,450 @@
+/*
+ * 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.avro.Schema;
+import org.apache.avro.generic.GenericRecord;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
+import org.apache.hudi.client.WriteStatus;
+import org.apache.hudi.common.config.HoodieMetadataConfig;
+import org.apache.hudi.common.config.TypedProperties;
+import org.apache.hudi.common.engine.LocalTaskContextSupplier;
+import org.apache.hudi.common.engine.TaskContextSupplier;
+import org.apache.hudi.common.fs.FSUtils;
+import org.apache.hudi.common.model.HoodiePartitionMetadata;
+import org.apache.hudi.common.model.HoodieRecord;
+import org.apache.hudi.common.model.HoodieWriteStat;
+import org.apache.hudi.common.model.IOType;
+import org.apache.hudi.common.table.HoodieTableMetaClient;
+import org.apache.hudi.common.testutils.HoodieCommonTestHarness;
+import org.apache.hudi.common.util.Option;
+import org.apache.hudi.common.util.ParquetUtils;
+import org.apache.hudi.config.HoodieWriteConfig;
+import org.apache.hudi.exception.HoodieInsertException;
+import org.apache.hudi.io.storage.HoodieFileWriter;
+import org.apache.hudi.storage.StoragePath;
+import org.apache.hudi.table.HoodieTable;
+import org.apache.hudi.table.TestBaseHoodieTable;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.Arguments;
+import org.junit.jupiter.params.provider.MethodSource;
+import org.mockito.junit.jupiter.MockitoExtension;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Stream;
+
+import static 
org.apache.hudi.common.testutils.HoodieTestDataGenerator.DEFAULT_FIRST_PARTITION_PATH;
+import static 
org.apache.hudi.common.testutils.HoodieTestDataGenerator.DEFAULT_PARTITION_PATHS;
+import static 
org.apache.hudi.common.testutils.HoodieTestDataGenerator.DEFAULT_SECOND_PARTITION_PATH;
+import static 
org.apache.hudi.common.testutils.HoodieTestDataGenerator.TRIP_EXAMPLE_SCHEMA;
+import static 
org.apache.hudi.common.testutils.HoodieTestDataGenerator.TRIP_FLATTENED_SCHEMA;
+import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.doThrow;
+import static org.mockito.Mockito.spy;
+
+@ExtendWith(MockitoExtension.class)
+public class TestHoodieCreateHandle extends HoodieCommonTestHarness {
+  private static final String TEST_INSTANT_TIME = "20231201120000";
+  private static final String TEST_FILE_ID = "file-001";
+  private static final Schema TEST_SCHEMA = new 
Schema.Parser().parse(TRIP_EXAMPLE_SCHEMA);
+  private static final String TEST_PARTITION_PATH = 
DEFAULT_FIRST_PARTITION_PATH;
+
+  private HoodieWriteConfig writeConfig;
+  private TaskContextSupplier taskContextSupplier;
+  private HoodieTable hoodieTable;
+
+  @BeforeEach
+  void setUp() throws IOException {
+    initPath();
+    initMetaClient(false);
+    initTestDataGenerator();
+
+    writeConfig = HoodieWriteConfig.newBuilder()
+      .withPath(basePath)
+      .withSchema(TRIP_EXAMPLE_SCHEMA)
+      .withMarkersType("DIRECT")
+      
.withMetadataConfig(HoodieMetadataConfig.newBuilder().enable(false).build())
+      .build();
+    hoodieTable = new TestBaseHoodieTable(writeConfig, getEngineContext(), 
metaClient);
+    taskContextSupplier = new LocalTaskContextSupplier();
+  }
+
+  @AfterEach
+  void tearDown() throws Exception {
+    cleanMetaClient();
+    cleanupTestDataGenerator();
+  }
+
+  @Test
+  void testConstructorWithBasicParameters() {
+    HoodieCreateHandle createHandle = new HoodieCreateHandle(
+        writeConfig, TEST_INSTANT_TIME, hoodieTable, TEST_PARTITION_PATH,
+        TEST_FILE_ID, taskContextSupplier);
+
+    assertNotNull(createHandle);
+    assertEquals(IOType.CREATE, createHandle.getIOType());
+    assertFalse(createHandle.preserveMetadata);
+  }
+
+  @Test
+  void testConstructorWithPreserveMetadata() {
+    HoodieCreateHandle createHandle = new HoodieCreateHandle(
+        writeConfig, TEST_INSTANT_TIME, hoodieTable, TEST_PARTITION_PATH,
+        TEST_FILE_ID, taskContextSupplier, true);
+
+    assertNotNull(createHandle);
+    assertTrue(createHandle.preserveMetadata);
+  }
+
+  @Test
+  public void testConstructorWithOverriddenSchema() {
+    Schema overridenSchema = new Schema.Parser().parse(TRIP_FLATTENED_SCHEMA);
+
+    HoodieCreateHandle handleWithOverridenSchema = new HoodieCreateHandle<>(
+        writeConfig, TEST_INSTANT_TIME, hoodieTable, TEST_PARTITION_PATH,
+        TEST_FILE_ID, Option.of(overridenSchema), taskContextSupplier);
+    assertEquals(overridenSchema, handleWithOverridenSchema.writeSchema);
+  }
+
+  @Test
+  void testConstructorCreatesPartitionMetadataAndMarkerAndBaseFile() throws 
Exception {
+    HoodieCreateHandle createHandle = new HoodieCreateHandle(
+        writeConfig, TEST_INSTANT_TIME, hoodieTable, TEST_PARTITION_PATH,
+        TEST_FILE_ID, taskContextSupplier);
+    assertNotNull(createHandle);
+
+    FileSystem fs = (FileSystem) metaClient.getStorage().getFileSystem();

Review Comment:
   Use `HoodieStorage` instance instead of `FileSystem`



##########
hudi-client/hudi-client-common/src/test/java/org/apache/hudi/io/TestHoodieCreateHandle.java:
##########
@@ -0,0 +1,450 @@
+/*
+ * 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.avro.Schema;
+import org.apache.avro.generic.GenericRecord;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;

Review Comment:
   Avoid hadoop imports



##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/io/AbstractCreateHandle.java:
##########
@@ -0,0 +1,230 @@
+/*
+ * 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.avro.Schema;
+import org.apache.hudi.client.WriteStatus;
+import org.apache.hudi.common.config.TypedProperties;
+import org.apache.hudi.common.engine.TaskContextSupplier;
+import org.apache.hudi.common.fs.FSUtils;
+import org.apache.hudi.common.model.HoodieOperation;
+import org.apache.hudi.common.model.HoodiePartitionMetadata;
+import org.apache.hudi.common.model.HoodieRecord;
+import org.apache.hudi.common.model.HoodieWriteStat;
+import org.apache.hudi.common.model.IOType;
+import org.apache.hudi.common.model.MetadataValues;
+import org.apache.hudi.common.util.Option;
+import org.apache.hudi.config.HoodieWriteConfig;
+import org.apache.hudi.exception.HoodieInsertException;
+import org.apache.hudi.io.storage.HoodieFileWriter;
+import org.apache.hudi.storage.StoragePath;
+import org.apache.hudi.table.HoodieTable;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;

Review Comment:
   non-hudi imports should come later in a separate import group.



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