mchades commented on code in PR #9576:
URL: https://github.com/apache/gravitino/pull/9576#discussion_r2764115704
##########
catalogs/hive-metastore-common/src/main/java/org/apache/gravitino/hive/converter/HiveDatabaseConverter.java:
##########
@@ -78,14 +79,17 @@ public static Database toHiveDb(HiveSchema hiveSchema) {
Database hiveDb = new Database();
hiveDb.setName(hiveSchema.name());
-
Optional.ofNullable(hiveSchema.properties().get(LOCATION)).ifPresent(hiveDb::setLocationUri);
+ Optional.ofNullable(hiveSchema.properties())
+ .map(props -> props.get(LOCATION))
+ .ifPresent(hiveDb::setLocationUri);
Optional.ofNullable(hiveSchema.comment()).ifPresent(hiveDb::setDescription);
// TODO: Add more privilege info to Hive's Database object after Gravitino
supports privilege.
hiveDb.setOwnerName(hiveSchema.auditInfo().creator());
hiveDb.setOwnerType(PrincipalType.USER);
- Map<String, String> parameters = new HashMap<>(hiveSchema.properties());
+ Map<String, String> parameters =
+
Optional.ofNullable(hiveSchema.properties()).map(HashMap::new).orElseGet(HashMap::new);
Review Comment:
I added UDF-related tests in HiveIT and then found and fixed this issue
--
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]