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


##########
hudi-utilities/src/main/java/org/apache/hudi/utilities/schema/converter/JsonToAvroSchemaConverterConfig.java:
##########
@@ -0,0 +1,51 @@
+/*
+ * 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.utilities.schema.converter;
+
+import org.apache.hudi.common.config.ConfigProperty;
+
+/**
+ * Configs for `JsonToAvroSchemaConverter`
+ */
+public class JsonToAvroSchemaConverterConfig {
+  public static final ConfigProperty<Boolean> CONVERT_DEFAULT_VALUE_TYPE = 
ConfigProperty
+      
.key("hoodie.streamer.schemaconverter.json_to_avro.convert_default_value_type")
+      .defaultValue(true)
+      .sinceVersion("1.1.0")
+      .withDocumentation("In 
`org.apache.hudi.utilities.schema.converter.JsonToAvroSchemaConverter`, "
+          + "whether to automatically convert the default value based on the 
field type in the "
+          + "schema. For example, the field schema is "
+          + "`\"col1\":{\"type\":\"integer\",\"default\":\"0\"`, and in this 
case, the default "
+          + "value is a String in JSON. After converting the type of the 
default value from JSON, "
+          + "the converter can properly insert the default value to the Avro 
schema without "
+          + "hitting Avro schema validation error. This should be turned on by 
default.");
+
+  public static final ConfigProperty<Boolean> STRIP_DEFAULT_VALUE_QUOTES = 
ConfigProperty
+      
.key("hoodie.streamer.schemaconverter.json_to_avro.strip_default_value_quotes")
+      .defaultValue(true)
+      .sinceVersion("0.14.1")

Review Comment:
   Fix since version.



##########
hudi-utilities/src/test/java/org/apache/hudi/utilities/sources/TestJsonKafkaSource.java:
##########
@@ -97,11 +111,11 @@ protected TypedProperties createPropsForKafkaSource(String 
topic, Long maxEvents
 
   static TypedProperties createPropsForJsonKafkaSource(String brokerAddress, 
String topic, Long maxEventsToReadFromKafkaSource, String resetStrategy) {
     TypedProperties props = new TypedProperties();
-    props.setProperty("hoodie.streamer.source.kafka.topic", topic);
+    props.setProperty("hoodie.deltastreamer.source.kafka.topic", topic);
     props.setProperty("bootstrap.servers", brokerAddress);
     props.setProperty("auto.offset.reset", resetStrategy);
     props.setProperty(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG, "false");
-    props.setProperty("hoodie.streamer.kafka.source.maxEvents",
+    props.setProperty("hoodie.deltastreamer.kafka.source.maxEvents",

Review Comment:
   Fix prefix.



##########
hudi-utilities/src/main/java/org/apache/hudi/utilities/schema/converter/JsonToAvroSchemaConverterConfig.java:
##########
@@ -0,0 +1,51 @@
+/*
+ * 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.utilities.schema.converter;
+
+import org.apache.hudi.common.config.ConfigProperty;
+
+/**
+ * Configs for `JsonToAvroSchemaConverter`
+ */
+public class JsonToAvroSchemaConverterConfig {
+  public static final ConfigProperty<Boolean> CONVERT_DEFAULT_VALUE_TYPE = 
ConfigProperty
+      
.key("hoodie.streamer.schemaconverter.json_to_avro.convert_default_value_type")
+      .defaultValue(true)
+      .sinceVersion("1.1.0")
+      .withDocumentation("In 
`org.apache.hudi.utilities.schema.converter.JsonToAvroSchemaConverter`, "
+          + "whether to automatically convert the default value based on the 
field type in the "
+          + "schema. For example, the field schema is "
+          + "`\"col1\":{\"type\":\"integer\",\"default\":\"0\"`, and in this 
case, the default "
+          + "value is a String in JSON. After converting the type of the 
default value from JSON, "
+          + "the converter can properly insert the default value to the Avro 
schema without "
+          + "hitting Avro schema validation error. This should be turned on by 
default.");
+
+  public static final ConfigProperty<Boolean> STRIP_DEFAULT_VALUE_QUOTES = 
ConfigProperty
+      
.key("hoodie.streamer.schemaconverter.json_to_avro.strip_default_value_quotes")
+      .defaultValue(true)
+      .sinceVersion("0.14.1")

Review Comment:
   Fixed.



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