omarsmak commented on a change in pull request #3162:
URL: https://github.com/apache/iceberg/pull/3162#discussion_r712989467
##########
File path: mr/src/main/java/org/apache/iceberg/mr/Catalogs.java
##########
@@ -269,23 +280,57 @@ public static boolean hiveCatalog(Configuration conf,
Properties props) {
* @return type of the catalog, can be null
*/
private static String getCatalogType(Configuration conf, String catalogName)
{
+ if (isCustomCatalogSet(conf, catalogName)) {
+ return null;
+ }
if (catalogName != null) {
- String catalogType = conf.get(InputFormatConfig.catalogPropertyConfigKey(
- catalogName, CatalogUtil.ICEBERG_CATALOG_TYPE));
- if (catalogName.equals(ICEBERG_HADOOP_TABLE_NAME)) {
- return NO_CATALOG_TYPE;
- } else {
- return catalogType;
- }
+ return getCatalogTypeFromCatalogName(conf, catalogName);
} else {
- String catalogType = conf.get(InputFormatConfig.CATALOG);
- if (catalogType == null) {
- return CatalogUtil.ICEBERG_CATALOG_TYPE_HIVE;
- } else if (catalogType.equals(LOCATION)) {
- return NO_CATALOG_TYPE;
- } else {
- return catalogType;
- }
+ return getLegacyCatalogType(conf);
+ }
+ }
+
+ /**
+ * Returns true if {@link CatalogProperties#CATALOG_IMPL} is set.
+ * @param conf global hive configuration
+ * @param catalogName name of the catalog
+ * @return true if {@link CatalogProperties#CATALOG_IMPL} is set
+ */
+ private static boolean isCustomCatalogSet(Configuration conf, String
catalogName) {
+ String catalogCustomImpl =
conf.get(InputFormatConfig.catalogPropertyConfigKey(
+ catalogName, CatalogProperties.CATALOG_IMPL));
+ return catalogCustomImpl != null;
Review comment:
Fixed
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]