This is an automated email from the ASF dual-hosted git repository. lzljs3620320 pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/flink-table-store.git
The following commit(s) were added to refs/heads/master by this push: new 6f50349 [FLINK-27004] Use '<format>.<option>' instead of 'file.<format>.<option>' in table properties of managed table 6f50349 is described below commit 6f5034901a35108fbf6727de5f14c170a97f1d2d Author: tsreaper <tsreape...@gmail.com> AuthorDate: Sat Apr 2 19:57:33 2022 +0800 [FLINK-27004] Use '<format>.<option>' instead of 'file.<format>.<option>' in table properties of managed table This closes #71 --- .../java/org/apache/flink/table/store/file/format/FileFormat.java | 5 ++--- .../test/java/org/apache/flink/table/store/file/FileFormatTest.java | 6 +++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/flink-table-store-core/src/main/java/org/apache/flink/table/store/file/format/FileFormat.java b/flink-table-store-core/src/main/java/org/apache/flink/table/store/file/format/FileFormat.java index fde866a..76c9cf9 100644 --- a/flink-table-store-core/src/main/java/org/apache/flink/table/store/file/format/FileFormat.java +++ b/flink-table-store-core/src/main/java/org/apache/flink/table/store/file/format/FileFormat.java @@ -33,7 +33,6 @@ import org.apache.flink.table.connector.sink.DynamicTableSink; import org.apache.flink.table.connector.source.DynamicTableSource; import org.apache.flink.table.data.RowData; import org.apache.flink.table.expressions.ResolvedExpression; -import org.apache.flink.table.factories.FactoryUtil; import org.apache.flink.table.runtime.typeutils.InternalTypeInfo; import org.apache.flink.table.store.file.stats.FileStatsExtractor; import org.apache.flink.table.types.DataType; @@ -105,8 +104,8 @@ public abstract class FileFormat { Configuration tableOptions, ConfigOption<String> formatOption) { String formatIdentifier = tableOptions.get(formatOption); - String formatPrefix = FactoryUtil.getFormatPrefix(formatOption, formatIdentifier); - ReadableConfig formatOptions = new DelegatingConfiguration(tableOptions, formatPrefix); + ReadableConfig formatOptions = + new DelegatingConfiguration(tableOptions, formatIdentifier + "."); return fromIdentifier(classLoader, formatIdentifier, formatOptions); } diff --git a/flink-table-store-core/src/test/java/org/apache/flink/table/store/file/FileFormatTest.java b/flink-table-store-core/src/test/java/org/apache/flink/table/store/file/FileFormatTest.java index 9102e6f..ce08143 100644 --- a/flink-table-store-core/src/test/java/org/apache/flink/table/store/file/FileFormatTest.java +++ b/flink-table-store-core/src/test/java/org/apache/flink/table/store/file/FileFormatTest.java @@ -42,7 +42,6 @@ import java.io.IOException; import java.util.ArrayList; import java.util.List; -import static org.apache.flink.table.factories.FactoryUtil.FORMAT; import static org.assertj.core.api.Assertions.assertThat; /** Test for {@link FileFormatImpl}. */ @@ -100,8 +99,9 @@ public class FileFormatTest { public FileFormat createFileFormat(String codec) { Configuration tableOptions = new Configuration(); - tableOptions.set(FORMAT, "avro"); + tableOptions.set(FileStoreOptions.FILE_FORMAT, "avro"); tableOptions.setString("avro.codec", codec); - return FileFormat.fromTableOptions(this.getClass().getClassLoader(), tableOptions, FORMAT); + return FileFormat.fromTableOptions( + this.getClass().getClassLoader(), tableOptions, FileStoreOptions.FILE_FORMAT); } }