@PublicEvolving public class HiveSourceBuilder extends Object
HiveSource
instances.Constructor and Description |
---|
HiveSourceBuilder(org.apache.hadoop.mapred.JobConf jobConf,
ReadableConfig flinkConf,
ObjectPath tablePath,
String hiveVersion,
ResolvedCatalogTable catalogTable)
Creates a builder to read a hive table.
|
HiveSourceBuilder(org.apache.hadoop.mapred.JobConf jobConf,
ReadableConfig flinkConf,
String hiveVersion,
String dbName,
String tableName,
Map<String,String> tableOptions)
Creates a builder to read a hive table.
|
Modifier and Type | Method and Description |
---|---|
<T> HiveSource<T> |
buildWithBulkFormat(BulkFormat<T,HiveSourceSplit> bulkFormat)
Builds HiveSource with custom BulkFormat.
|
HiveSource<RowData> |
buildWithDefaultBulkFormat()
Builds HiveSource with default built-in BulkFormat that returns records in type of RowData.
|
protected BulkFormat<RowData,HiveSourceSplit> |
createDefaultBulkFormat() |
HiveSourceBuilder |
setDynamicFilterPartitionKeys(List<String> dynamicFilterPartitionKeys) |
HiveSourceBuilder |
setLimit(Long limit)
Sets the maximum number of records this source should return.
|
HiveSourceBuilder |
setPartitions(List<HiveTablePartition> partitions)
Sets the partitions to read in batch mode.
|
HiveSourceBuilder |
setProjectedFields(int[] projectedFields)
Sets the indices of projected fields.
|
public HiveSourceBuilder(@Nonnull org.apache.hadoop.mapred.JobConf jobConf, @Nonnull ReadableConfig flinkConf, @Nullable String hiveVersion, @Nonnull String dbName, @Nonnull String tableName, @Nonnull Map<String,String> tableOptions)
jobConf
- holds hive and hadoop configurationsflinkConf
- holds flink configurationshiveVersion
- the version of hive in use, if it's null the version will be automatically
detecteddbName
- the name of the database the table belongs totableName
- the name of the tabletableOptions
- additional options needed to read the table, which take precedence over
table properties stored in metastorepublic HiveSourceBuilder(@Nonnull org.apache.hadoop.mapred.JobConf jobConf, @Nonnull ReadableConfig flinkConf, @Nonnull ObjectPath tablePath, @Nullable String hiveVersion, @Nonnull ResolvedCatalogTable catalogTable)
jobConf
- holds hive and hadoop configurationsflinkConf
- holds flink configurationshiveVersion
- the version of hive in use, if it's null the version will be automatically
detectedtablePath
- path of the table to be readcatalogTable
- the table to be readpublic HiveSource<RowData> buildWithDefaultBulkFormat()
public <T> HiveSource<T> buildWithBulkFormat(BulkFormat<T,HiveSourceSplit> bulkFormat)
public HiveSourceBuilder setPartitions(List<HiveTablePartition> partitions)
public HiveSourceBuilder setDynamicFilterPartitionKeys(List<String> dynamicFilterPartitionKeys)
public HiveSourceBuilder setLimit(Long limit)
public HiveSourceBuilder setProjectedFields(int[] projectedFields)
projectedFields
- indices of the fields, starting from 0protected BulkFormat<RowData,HiveSourceSplit> createDefaultBulkFormat()
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.