zhedoubushishi commented on a change in pull request #2328:
URL: https://github.com/apache/hudi/pull/2328#discussion_r548424524
##########
File path:
hudi-spark-datasource/hudi-spark2/src/test/java/org/apache/hudi/internal/TestHoodieBulkInsertDataInternalWriter.java
##########
@@ -18,63 +18,32 @@
package org.apache.hudi.internal;
-import org.apache.hudi.client.HoodieInternalWriteStatus;
-import org.apache.hudi.common.model.HoodieRecord;
-import org.apache.hudi.common.model.HoodieWriteStat;
import org.apache.hudi.common.testutils.HoodieTestDataGenerator;
import org.apache.hudi.config.HoodieWriteConfig;
import org.apache.hudi.table.HoodieSparkTable;
import org.apache.hudi.table.HoodieTable;
-import org.apache.hudi.testutils.HoodieClientTestHarness;
-import org.apache.spark.package$;
import org.apache.spark.sql.Dataset;
import org.apache.spark.sql.Row;
import org.apache.spark.sql.catalyst.InternalRow;
-import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import java.util.ArrayList;
import java.util.List;
-import java.util.Random;
import static org.apache.hudi.testutils.SparkDatasetTestUtils.ENCODER;
import static org.apache.hudi.testutils.SparkDatasetTestUtils.STRUCT_TYPE;
import static org.apache.hudi.testutils.SparkDatasetTestUtils.getConfigBuilder;
import static
org.apache.hudi.testutils.SparkDatasetTestUtils.getInternalRowWithError;
import static org.apache.hudi.testutils.SparkDatasetTestUtils.getRandomRows;
import static org.apache.hudi.testutils.SparkDatasetTestUtils.toInternalRows;
-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.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;
-import static org.junit.jupiter.api.Assumptions.assumeTrue;
/**
* Unit tests {@link HoodieBulkInsertDataInternalWriter}.
*/
-public class TestHoodieBulkInsertDataInternalWriter extends
HoodieClientTestHarness {
-
- private static final Random RANDOM = new Random();
-
- @BeforeEach
- public void setUp() throws Exception {
- // this test is only compatible with spark 2
- assumeTrue(package$.MODULE$.SPARK_VERSION().startsWith("2."));
- initSparkContexts("TestHoodieBulkInsertDataInternalWriter");
- initPath();
- initFileSystem();
- initTestDataGenerator();
- initMetaClient();
- }
-
- @AfterEach
- public void tearDown() throws Exception {
- cleanupResources();
- }
+public class TestHoodieBulkInsertDataInternalWriter extends
Review comment:
Currently one class mainly tests
```HoodieBulkInsertDataInternalWriter```, one class mainly tests
```HoodieDataSourceInternalBatchWrite```. I am not sure if we should merge them
into one. But definitely we can do this.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]