mchades commented on code in PR #9460:
URL: https://github.com/apache/gravitino/pull/9460#discussion_r2610240055
##########
catalogs/catalog-lakehouse-hudi/src/main/java/org/apache/gravitino/catalog/lakehouse/hudi/backend/hms/HudiHMSBackendOps.java:
##########
@@ -231,44 +204,9 @@ private boolean checkHudiTable(Table table) {
// uses `org.apache.hudi.hadoop.HoodieParquetInputFormat` and MOR table
// uses `org.apache.hudi.hadoop.HoodieParquetRealtimeInputFormat`, to
// simplify the logic, we just check the prefix of the input format
- return table.getSd().getInputFormat() != null
- && table.getSd().getInputFormat().startsWith(HUDI_PACKAGE_PREFIX);
- }
-
- private HiveConf buildHiveConfAndInitKerberosAuth(Map<String, String>
properties) {
- Configuration hadoopConf = new Configuration();
-
- Map<String, String> byPassConfigs = Maps.newHashMap();
- Map<String, String> convertedConfigs = Maps.newHashMap();
- properties.forEach(
- (key, value) -> {
- if (key.startsWith(CATALOG_BYPASS_PREFIX)) {
- byPassConfigs.put(key.substring(CATALOG_BYPASS_PREFIX.length()),
value);
- } else if (CONFIG_CONVERTER.containsKey(key)) {
- convertedConfigs.put(CONFIG_CONVERTER.get(key), value);
- } else {
- hadoopConf.set(key, value);
- }
- });
- byPassConfigs.forEach(hadoopConf::set);
- convertedConfigs.forEach(hadoopConf::set);
- initKerberosAuth(properties, hadoopConf);
- return new HiveConf(hadoopConf, HudiHMSBackendOps.class);
- }
- private void initKerberosAuth(Map<String, String> properties, Configuration
hadoopConf) {
- AuthenticationConfig authenticationConfig = new
AuthenticationConfig(properties);
- if (authenticationConfig.isKerberosAuth()) {
- try (KerberosClient kerberosClient = new KerberosClient(properties,
hadoopConf, true)) {
- String keytabPath =
- String.format(
- GRAVITINO_KEYTAB_FORMAT,
properties.getOrDefault(CatalogUtils.CATALOG_ID_KEY, "0"));
- File keytabFile = kerberosClient.saveKeyTabFileFromUri(keytabPath);
- kerberosClient.login(keytabFile.getAbsolutePath());
- LOG.info("Login with kerberos success");
- } catch (IOException e) {
- throw new RuntimeException("Failed to login with kerberos", e);
- }
- }
+ // todo yuhui: better way to identify Hudi table?
+ String inputFormat = table.properties().get("input-format");
+ return inputFormat != null && inputFormat.startsWith(HUDI_PACKAGE_PREFIX);
Review Comment:
Does this change break compatibility?
--
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]