SourabhBadhya commented on code in PR #5789:
URL: https://github.com/apache/hive/pull/5789#discussion_r2100618683


##########
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergSerDe.java:
##########
@@ -126,41 +124,41 @@ public void initialize(@Nullable Configuration 
configuration, Properties serDePr
             }
           }
         } else {
-          boolean autoConversion = 
configuration.getBoolean(InputFormatConfig.SCHEMA_AUTO_CONVERSION, false);
+          boolean autoConversion = 
conf.getBoolean(InputFormatConfig.SCHEMA_AUTO_CONVERSION, false);
           // If we can not load the table try the provided hive schema
           this.tableSchema = hiveSchemaOrThrow(e, autoConversion);
           // This is only for table creation, it is ok to have an empty 
partition column list
           this.partitionColumns = ImmutableList.of();
         }
         if (e instanceof NoSuchTableException &&
-            HiveTableUtil.isCtas(serDeProperties) &&
-            !Catalogs.hiveCatalog(configuration, serDeProperties)) {
+            HiveTableUtil.isCtas(serDeProperties) && 
!Catalogs.hiveCatalog(conf, serDeProperties)) {
           throw new SerDeException(CTAS_EXCEPTION_MSG);
         }
       }
     }
 
     this.projectedSchema =
-        projectedSchema(configuration, 
serDeProperties.getProperty(Catalogs.NAME), tableSchema, jobConf);
+        projectedSchema(conf, serDeProperties.getProperty(Catalogs.NAME), 
tableSchema, jobConf);
 
-    // Currently ClusteredWriter is used which requires that records are 
ordered by partition keys.
-    // Here we ensure that SortedDynPartitionOptimizer will kick in and do the 
sorting.
-    // TODO: remove once we have both Fanout and ClusteredWriter available: 
HIVE-25948
-    HiveConf.setIntVar(configuration, 
HiveConf.ConfVars.HIVE_OPT_SORT_DYNAMIC_PARTITION_THRESHOLD, 1);
-    HiveConf.setVar(configuration, 
HiveConf.ConfVars.DYNAMIC_PARTITIONING_MODE, "nonstrict");
+    if 
(!IcebergTableUtil.isFanoutEnabled(Maps.fromProperties(serDeProperties))) {
+      // ClusteredWriter requires that records are ordered by partition keys.
+      // Here we ensure that SortedDynPartitionOptimizer will kick in and do 
the sorting.
+      HiveConf.setIntVar(conf, 
HiveConf.ConfVars.HIVE_OPT_SORT_DYNAMIC_PARTITION_THRESHOLD, 1);
+    }
+    HiveConf.setVar(conf, HiveConf.ConfVars.DYNAMIC_PARTITIONING_MODE, 
"nonstrict");

Review Comment:
   Why set this config? Shouldn't it be always "nonstrict"?



-- 
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: gitbox-unsubscr...@hive.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org
For additional commands, e-mail: gitbox-h...@hive.apache.org

Reply via email to