public class FileSystemTableFactory extends Object implements TableSourceFactory<RowData>, TableSinkFactory<RowData>
TableFactory
.
1.The partition information should be in the file system path, whether it's a temporary table or a catalog table. 2.Support insert into (append) and insert overwrite. 3.Support static and dynamic partition inserting.
Migrate to new source/sink interface after FLIP-95 is ready.
TableSourceFactory.Context
TableSinkFactory.Context
Modifier and Type | Field and Description |
---|---|
static String |
IDENTIFIER |
Constructor and Description |
---|
FileSystemTableFactory() |
Modifier and Type | Method and Description |
---|---|
static FileSystemFormatFactory |
createFormatFactory(Map<String,String> properties) |
TableSink<RowData> |
createTableSink(TableSinkFactory.Context context)
Creates and configures a
TableSink based on the given TableSinkFactory.Context . |
TableSource<RowData> |
createTableSource(TableSourceFactory.Context context)
Creates and configures a
TableSource based on the given TableSourceFactory.Context . |
Map<String,String> |
requiredContext()
Specifies the context that this factory has been implemented for.
|
List<String> |
supportedProperties()
List of property keys that this factory can handle.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createTableSource, createTableSource
createTableSink, createTableSink
public static final String IDENTIFIER
public Map<String,String> requiredContext()
TableFactory
Typical properties might be: - connector.type - format.type
Specified property versions allow the framework to provide backwards compatible properties in case of string format changes: - connector.property-version - format.property-version
An empty context means that the factory matches for all requests.
requiredContext
in interface TableFactory
public List<String> supportedProperties()
TableFactory
Example properties might be: - schema.#.type - schema.#.name - connector.topic - format.line-delimiter - format.ignore-parse-errors - format.fields.#.type - format.fields.#.name
Note: Use "#" to denote an array of values where "#" represents one or more digits. Property versions like "format.property-version" must not be part of the supported properties.
In some cases it might be useful to declare wildcards "*". Wildcards can only be declared at the end of a property key.
For example, if an arbitrary format should be supported: - format.*
Note: Wildcards should be used with caution as they might swallow unsupported properties and thus might lead to undesired behavior.
supportedProperties
in interface TableFactory
public TableSource<RowData> createTableSource(TableSourceFactory.Context context)
TableSourceFactory
TableSource
based on the given TableSourceFactory.Context
.createTableSource
in interface TableSourceFactory<RowData>
context
- context of this table source.public TableSink<RowData> createTableSink(TableSinkFactory.Context context)
TableSinkFactory
TableSink
based on the given TableSinkFactory.Context
.createTableSink
in interface TableSinkFactory<RowData>
context
- context of this table sink.public static FileSystemFormatFactory createFormatFactory(Map<String,String> properties)
Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.