codope commented on a change in pull request #3771:
URL: https://github.com/apache/hudi/pull/3771#discussion_r728752802
##########
File path:
hudi-sync/hudi-hive-sync/src/main/java/org/apache/hudi/hive/HiveSyncTool.java
##########
@@ -77,6 +77,10 @@ public HiveSyncTool(HiveSyncConfig cfg, HiveConf
configuration, FileSystem fs) {
super(configuration.getAllProperties(), fs);
try {
+ if (cfg.useKerberos) {
+ configuration.set("hive.metastore.sasl.enabled", "true");
+ configuration.set("hive.metastore.kerberos.principal",
cfg.kerberosPrincipal);
Review comment:
Let's validate that `cfg.kerberosPrincipal` is not null in this case.
##########
File path:
hudi-spark-datasource/hudi-spark-common/src/main/java/org/apache/hudi/DataSourceUtils.java
##########
@@ -307,6 +307,10 @@ public static HiveSyncConfig
buildHiveSyncConfig(TypedProperties props, String b
DataSourceWriteOptions.HIVE_SKIP_RO_SUFFIX_FOR_READ_OPTIMIZED_TABLE().defaultValue()));
hiveSyncConfig.supportTimestamp =
Boolean.valueOf(props.getString(DataSourceWriteOptions.HIVE_SUPPORT_TIMESTAMP_TYPE().key(),
DataSourceWriteOptions.HIVE_SUPPORT_TIMESTAMP_TYPE().defaultValue()));
+ hiveSyncConfig.useKerberos =
+
Boolean.valueOf(props.getString(DataSourceWriteOptions.HIVE_SYNC_USE_KERBEROS().key(),DataSourceWriteOptions.HIVE_SYNC_USE_KERBEROS().defaultValue()));
+ hiveSyncConfig.kerberosPrincipal =
+
props.getString(DataSourceWriteOptions.HIVE_SYNC_KERBEROS_PRINCIPAL().key(),
DataSourceWriteOptions.HIVE_SYNC_KERBEROS_PRINCIPAL().defaultValue());
Review comment:
`HIVE_SYNC_KERBEROS_PRINCIPAL` has null default value. This might throw
HoodieException. Maybe, we can set EMPTY_STRING as default and validate in
HiveSyncTool that this config is not null or empty when
`HIVE_SYNC_USE_KERBEROS` is true.
##########
File path:
hudi-spark-datasource/hudi-spark-common/src/main/java/org/apache/hudi/DataSourceUtils.java
##########
@@ -307,6 +307,10 @@ public static HiveSyncConfig
buildHiveSyncConfig(TypedProperties props, String b
DataSourceWriteOptions.HIVE_SKIP_RO_SUFFIX_FOR_READ_OPTIMIZED_TABLE().defaultValue()));
hiveSyncConfig.supportTimestamp =
Boolean.valueOf(props.getString(DataSourceWriteOptions.HIVE_SUPPORT_TIMESTAMP_TYPE().key(),
DataSourceWriteOptions.HIVE_SUPPORT_TIMESTAMP_TYPE().defaultValue()));
+ hiveSyncConfig.useKerberos =
+
Boolean.valueOf(props.getString(DataSourceWriteOptions.HIVE_SYNC_USE_KERBEROS().key(),DataSourceWriteOptions.HIVE_SYNC_USE_KERBEROS().defaultValue()));
Review comment:
Can we add a unit test in TestDataSourceUtils or TestHiveSyncTool?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]