跳到主要内容
版本:2.1.0

Hive

Sink plugin: Hive [Spark]

Description

Write Rows to Apache Hive.

Options

nametyperequireddefault value
sqlstringno-
source_table_namestringno-
result_table_namestringno-
sink_columnsstringno-
save_modestringno-
partition_byArray[string]no-
sql [string]

Hive sql:insert into/overwrite $table select * from xxx_table

If this option exists, other options will be ignored

Source_table_name [string]

Datasource of this plugin.

result_table_name [string]

The output hive table name.

save_mode [string]

Same with option spark.mode in Spark.

sink_columns [string]

Select the required fields in source_table_name and store them in result_table_name, separated by commas.

partition_by [Array[string]]

Hive partition fields

Example

sink {
Hive {
sql = "insert overwrite table seatunnel.test1 partition(province) select name,age,province from myTable2"
}
}
sink {
Hive {
source_table_name = "myTable2"
result_table_name = "seatunnel.test1"
save_mode = "overwrite"
sink_columns = "name,age,province"
partition_by = ["province"]
}
}