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


##########
ql/src/java/org/apache/hadoop/hive/ql/metadata/Table.java:
##########
@@ -776,9 +781,15 @@ private List<FieldSchema> getColsInternal(boolean forMs) {
    * @return List&lt;FieldSchema&gt;
    */
   public List<FieldSchema> getAllCols() {
-    ArrayList<FieldSchema> f_list = new ArrayList<FieldSchema>();
-    f_list.addAll(getCols());
-    f_list.addAll(getPartCols());
+    ArrayList<FieldSchema> f_list = new ArrayList<FieldSchema>(getCols());
+    Set<String> colNames = f_list.stream()
+        .map(FieldSchema::getName)
+        .collect(Collectors.toSet());
+    for (FieldSchema f : getPartCols(true)) {

Review Comment:
   No, so basically we had a flaw here in this method:
   ```
   f_list.addAll(getCols());
   f_list.addAll(getPartCols());
   ```
   getCols for iceberg tables also returns the partition columns as well so we 
shouldn't have redundant columns after introducing non native support for 
getPartCols method so using hashset to avoid that kind of scenario



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