Skip to content

Commit

Permalink
[HUDI-2891] Fix write configs for Java engine in Kafka Connect Sink (#…
Browse files Browse the repository at this point in the history
…4161)

(cherry picked from commit ea009b5)
  • Loading branch information
yihua authored and danny0405 committed Dec 4, 2021
1 parent 63a7df7 commit c38ebbc
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 2 deletions.
1 change: 0 additions & 1 deletion hudi-kafka-connect/demo/config-sink-hive.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"topics": "hudi-test-topic",
"hoodie.table.name": "hudi-test-topic",
"hoodie.table.type": "MERGE_ON_READ",
"hoodie.metadata.enable": "false",
"hoodie.base.path": "hdfs://namenode:8020/user/hive/warehouse/hudi-test-topic",
"hoodie.datasource.write.recordkey.field": "volume",
"hoodie.datasource.write.partitionpath.field": "date",
Expand Down
1 change: 0 additions & 1 deletion hudi-kafka-connect/demo/config-sink.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"topics": "hudi-test-topic",
"hoodie.table.name": "hudi-test-topic",
"hoodie.table.type": "MERGE_ON_READ",
"hoodie.metadata.enable": "false",
"hoodie.base.path": "file:///tmp/hoodie/hudi-test-topic",
"hoodie.datasource.write.recordkey.field": "volume",
"hoodie.datasource.write.partitionpath.field": "date",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.apache.hudi.client.WriteStatus;
import org.apache.hudi.client.common.HoodieJavaEngineContext;
import org.apache.hudi.common.config.TypedProperties;
import org.apache.hudi.common.engine.EngineType;
import org.apache.hudi.common.engine.HoodieEngineContext;
import org.apache.hudi.common.model.HoodieAvroPayload;
import org.apache.hudi.common.util.ReflectionUtils;
Expand Down Expand Up @@ -74,6 +75,7 @@ public KafkaConnectWriterProvider(

// Create the write client to write some records in
writeConfig = HoodieWriteConfig.newBuilder()
.withEngineType(EngineType.JAVA)
.withProperties(connectConfigs.getProps())
.withFileIdPrefixProviderClassName(KafkaConnectFileIdPrefixProvider.class.getName())
.withProps(Collections.singletonMap(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import org.apache.hudi.client.HoodieJavaWriteClient;
import org.apache.hudi.client.common.HoodieJavaEngineContext;
import org.apache.hudi.common.engine.EngineType;
import org.apache.hudi.common.model.HoodieRecord;
import org.apache.hudi.common.testutils.HoodieTestDataGenerator;
import org.apache.hudi.common.util.Option;
Expand Down Expand Up @@ -62,6 +63,7 @@ public void setUp() throws Exception {
configs = KafkaConnectConfigs.newBuilder().build();
schemaProvider = new TestAbstractConnectWriter.TestSchemaProvider();
writeConfig = HoodieWriteConfig.newBuilder()
.withEngineType(EngineType.JAVA)
.withPath("/tmp")
.withSchema(schemaProvider.getSourceSchema().toString())
.build();
Expand Down

0 comments on commit c38ebbc

Please sign in to comment.