You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2021/09/22 17:48:46 UTC

[GitHub] [iceberg] rdblue commented on a change in pull request #3162: Hive: Throw an exception if both catalog type and catalog-impl are set

rdblue commented on a change in pull request #3162:
URL: https://github.com/apache/iceberg/pull/3162#discussion_r714176125



##########
File path: mr/src/main/java/org/apache/iceberg/mr/Catalogs.java
##########
@@ -243,15 +243,21 @@ public static boolean hiveCatalog(Configuration conf, Properties props) {
    */
   private static Map<String, String> addCatalogPropertiesIfMissing(Configuration conf, String catalogType,
                                                                    Map<String, String> catalogProperties) {
-    if (catalogType != null) {
-      catalogProperties.putIfAbsent(CatalogUtil.ICEBERG_CATALOG_TYPE, catalogType);
-    }
-
     String legacyCatalogImpl = conf.get(InputFormatConfig.CATALOG_LOADER_CLASS);
     if (legacyCatalogImpl != null) {
       catalogProperties.putIfAbsent(CatalogProperties.CATALOG_IMPL, legacyCatalogImpl);
     }
 
+    if (catalogProperties.containsKey(CatalogUtil.ICEBERG_CATALOG_TYPE) &&
+            catalogProperties.containsKey(CatalogProperties.CATALOG_IMPL)) {

Review comment:
       Indentation isn't correct in this file. Continuation indents should be 4 spaces.

##########
File path: mr/src/main/java/org/apache/iceberg/mr/Catalogs.java
##########
@@ -243,15 +243,21 @@ public static boolean hiveCatalog(Configuration conf, Properties props) {
    */
   private static Map<String, String> addCatalogPropertiesIfMissing(Configuration conf, String catalogType,
                                                                    Map<String, String> catalogProperties) {
-    if (catalogType != null) {
-      catalogProperties.putIfAbsent(CatalogUtil.ICEBERG_CATALOG_TYPE, catalogType);
-    }
-
     String legacyCatalogImpl = conf.get(InputFormatConfig.CATALOG_LOADER_CLASS);
     if (legacyCatalogImpl != null) {
       catalogProperties.putIfAbsent(CatalogProperties.CATALOG_IMPL, legacyCatalogImpl);
     }
 
+    if (catalogProperties.containsKey(CatalogUtil.ICEBERG_CATALOG_TYPE) &&
+            catalogProperties.containsKey(CatalogProperties.CATALOG_IMPL)) {

Review comment:
       Indentation isn't correct in this PR. Continuation indents should be 4 spaces.




-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org