public class HiveTableFactory extends Object implements TableSourceFactory<Row>, TableSinkFactory<Row>, FunctionDefinitionFactory
Constructor and Description |
---|
HiveTableFactory(org.apache.hadoop.hive.conf.HiveConf hiveConf) |
Modifier and Type | Method and Description |
---|---|
FunctionDefinition |
createFunctionDefinition(String name,
CatalogFunction catalogFunction)
Creates a
FunctionDefinition from given CatalogFunction . |
TableSink<Row> |
createTableSink(Map<String,String> properties)
Creates and configures a
TableSink using the given properties. |
TableSink<Row> |
createTableSink(ObjectPath tablePath,
CatalogTable table)
Creates and configures a
TableSink based on the given CatalogTable instance. |
TableSource<Row> |
createTableSource(Map<String,String> properties)
Creates and configures a
TableSource using the given properties. |
TableSource<Row> |
createTableSource(ObjectPath tablePath,
CatalogTable table)
Creates and configures a
TableSource based on the given CatalogTable instance. |
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.
|
public HiveTableFactory(org.apache.hadoop.hive.conf.HiveConf hiveConf)
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 TableSink<Row> createTableSink(Map<String,String> properties)
TableSinkFactory
TableSink
using the given properties.createTableSink
in interface TableSinkFactory<Row>
properties
- normalized properties describing a table sink.public TableSource<Row> createTableSource(Map<String,String> properties)
TableSourceFactory
TableSource
using the given properties.createTableSource
in interface TableSourceFactory<Row>
properties
- normalized properties describing a table source.public TableSource<Row> createTableSource(ObjectPath tablePath, CatalogTable table)
TableSourceFactory
TableSource
based on the given CatalogTable
instance.createTableSource
in interface TableSourceFactory<Row>
tablePath
- path of the given CatalogTable
table
- CatalogTable
instance.public TableSink<Row> createTableSink(ObjectPath tablePath, CatalogTable table)
TableSinkFactory
TableSink
based on the given CatalogTable
instance.createTableSink
in interface TableSinkFactory<Row>
tablePath
- path of the given CatalogTable
table
- CatalogTable
instance.public FunctionDefinition createFunctionDefinition(String name, CatalogFunction catalogFunction)
FunctionDefinitionFactory
FunctionDefinition
from given CatalogFunction
.createFunctionDefinition
in interface FunctionDefinitionFactory
name
- name of the CatalogFunction
catalogFunction
- the catalog functionFunctionDefinition
Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.