1
0

[HUDI-3589] flink sync hive metadata supports table properties and serde properties (#4995)

This commit is contained in:
todd5167
2022-03-16 03:56:37 +08:00
committed by GitHub
parent d514570e90
commit 55dca969f9
2 changed files with 14 additions and 0 deletions

View File

@@ -675,6 +675,18 @@ public class FlinkOptions extends HoodieConfig {
.withDescription("INT64 with original type TIMESTAMP_MICROS is converted to hive timestamp type.\n"
+ "Disabled by default for backward compatibility.");
public static final ConfigOption<String> HIVE_SYNC_TABLE_PROPERTIES = ConfigOptions
.key("hive_sync.table_properties")
.stringType()
.noDefaultValue()
.withDescription("Additional properties to store with table, the data format is k1=v1\nk2=v2");
public static final ConfigOption<String> HIVE_SYNC_TABLE_SERDE_PROPERTIES = ConfigOptions
.key("hive_sync.serde_properties")
.stringType()
.noDefaultValue()
.withDescription("Serde properties to hive table, the data format is k1=v1\nk2=v2");
// -------------------------------------------------------------------------
// Utilities
// -------------------------------------------------------------------------

View File

@@ -74,6 +74,8 @@ public class HiveSyncContext {
hiveSyncConfig.syncMode = conf.getString(FlinkOptions.HIVE_SYNC_MODE);
hiveSyncConfig.hiveUser = conf.getString(FlinkOptions.HIVE_SYNC_USERNAME);
hiveSyncConfig.hivePass = conf.getString(FlinkOptions.HIVE_SYNC_PASSWORD);
hiveSyncConfig.tableProperties = conf.getString(FlinkOptions.HIVE_SYNC_TABLE_PROPERTIES);
hiveSyncConfig.serdeProperties = conf.getString(FlinkOptions.HIVE_SYNC_TABLE_SERDE_PROPERTIES);
hiveSyncConfig.jdbcUrl = conf.getString(FlinkOptions.HIVE_SYNC_JDBC_URL);
hiveSyncConfig.partitionFields = Arrays.asList(FilePathUtils.extractPartitionKeys(conf));
hiveSyncConfig.partitionValueExtractorClass = conf.getString(FlinkOptions.HIVE_SYNC_PARTITION_EXTRACTOR_CLASS_NAME);