ramitg254 commented on code in PR #6413:
URL: https://github.com/apache/hive/pull/6413#discussion_r3395024874


##########
ql/src/java/org/apache/hadoop/hive/ql/metadata/Table.java:
##########
@@ -595,26 +606,46 @@ public boolean equals(Object obj) {
         && Objects.equals(snapshotRef, other.snapshotRef);
   }
 
+
+  /**
+   * Returns partition columns, consulting the storage handler for non-native 
tables (e.g. Iceberg)
+   * where partition columns are not stored in the metastore.
+   */
   public List<FieldSchema> getPartCols() {
-    List<FieldSchema> partKeys = tTable.getPartitionKeys();
-    if (partKeys == null) {
-      partKeys = new ArrayList<>();
-      tTable.setPartitionKeys(partKeys);
+    if (tablePartCols != null) {
+      return tablePartCols;
+    }
+    if (isTableTypeSet() && hasNonNativePartitionSupport()) {
+      List<FieldSchema> partCols = getStorageHandler().getPartitionKeys(this);
+      for (FieldSchema partCol : partCols) {
+        FieldSchema storageSchemaField = 
getFieldSchemaByName(partCol.getName());

Review Comment:
   pushed this implementation for now, it will break some tests where column 
comments are matched and will check accordingly
   if you have any other ideas we can proceed with that as well



##########
ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java:
##########
@@ -11999,47 +12007,45 @@ private Operator genTablePlan(String alias, QB qb) 
throws SemanticException {
       // Determine row schema for TSOP.
       // Include column names from SerDe, the partition and virtual columns.
       rwsch = new RowResolver();
-      try {
-        // Including parameters passed in the query
-        if (properties != null) {
-          for (Entry<String, String> prop : properties.entrySet()) {
-            if (tab.getSerdeParam(prop.getKey()) != null) {
-              LOG.warn("SerDe property in input query overrides stored SerDe 
property");
-            }
-            tab.setSerdeParam(prop.getKey(), prop.getValue());
+      // Including parameters passed in the query
+      if (properties != null) {
+        for (Entry<String, String> prop : properties.entrySet()) {
+          if (tab.getSerdeParam(prop.getKey()) != null) {
+            LOG.warn("SerDe property in input query overrides stored SerDe 
property");
           }
+          tab.setSerdeParam(prop.getKey(), prop.getValue());
         }
-        // Obtain inspector for schema
-        final Deserializer deserializer = tab.getDeserializer();
-        StructObjectInspector rowObjectInspector = (StructObjectInspector) 
deserializer.getObjectInspector();
+      }
+      final Deserializer deserializer = tab.getDeserializer();
 
-        deserializer.handleJobLevelConfiguration(conf);
-        List<? extends StructField> fields = rowObjectInspector
-            .getAllStructFieldRefs();

Review Comment:
   done



-- 
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]

Reply via email to