yanghua commented on a change in pull request #2658:
URL: https://github.com/apache/hudi/pull/2658#discussion_r592120641
##########
File path: hudi-flink/src/main/java/org/apache/hudi/operator/FlinkOptions.java
##########
@@ -81,6 +81,12 @@ private FlinkOptions() {
.noDefaultValue()
.withDescription("Avro schema file path, the parsed schema is used for
deserializing");
+ public static final ConfigOption<String> READ_SCHEMA_STRING = ConfigOptions
+ .key("read.schema.string")
+ .stringType()
+ .noDefaultValue()
+ .withDescription("Avro schema string, the parsed schema is used for
deserialization");
Review comment:
Thinking if we'd better add the `AVRO` keyword into the variable name.
##########
File path:
hudi-flink/src/test/java/org/apache/hudi/factory/TestHoodieTableFactory.java
##########
@@ -0,0 +1,176 @@
+/*
+ * 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.factory;
+
+import org.apache.hudi.operator.FlinkOptions;
+import org.apache.hudi.operator.utils.TestConfigurations;
+import org.apache.hudi.sink.HoodieTableSink;
+import org.apache.hudi.source.HoodieTableSource;
+import org.apache.hudi.util.StreamerUtil;
+
+import org.apache.flink.configuration.Configuration;
+import org.apache.flink.configuration.ReadableConfig;
+import org.apache.flink.table.catalog.CatalogTable;
+import org.apache.flink.table.catalog.CatalogTableImpl;
+import org.apache.flink.table.catalog.ObjectIdentifier;
+import org.apache.flink.table.factories.TableSinkFactory;
+import org.apache.flink.table.factories.TableSourceFactory;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.io.TempDir;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.Objects;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.junit.jupiter.api.Assertions.assertNull;
+
+/**
+ * Test cases for {@link HoodieTableFactory}.
+ */
+public class TestHoodieTableFactory {
+ private static final String AVRO_SCHEMA_FILE_PATH =
Objects.requireNonNull(Thread.currentThread()
+
.getContextClassLoader().getResource("test_read_schema.avsc")).toString();
+ private static final String INFERRED_SCHEMA = "{\"type\":\"record\","
+ + "\"name\":\"record\","
+ + "\"fields\":["
+ + "{\"name\":\"uuid\",\"type\":[\"null\",\"string\"],\"default\":null},"
+ + "{\"name\":\"name\",\"type\":[\"null\",\"string\"],\"default\":null},"
+ + "{\"name\":\"age\",\"type\":[\"null\",\"int\"],\"default\":null},"
+ +
"{\"name\":\"ts\",\"type\":[\"null\",{\"type\":\"long\",\"logicalType\":\"timestamp-millis\"}],\"default\":null},"
+ +
"{\"name\":\"partition\",\"type\":[\"null\",\"string\"],\"default\":null}]}";
+ private Configuration conf;
Review comment:
Let us add an empty line to split the constant and the variable?
----------------------------------------------------------------
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]