soumyakanti3578 commented on code in PR #5798:
URL: https://github.com/apache/hive/pull/5798#discussion_r2075967927


##########
ql/src/java/org/apache/hadoop/hive/ql/metadata/Table.java:
##########
@@ -1364,4 +1365,16 @@ public SourceTable createSourceTable() {
     sourceTable.setDeletedCount(0L);
     return sourceTable;
   }
+  
+  public boolean isDruidTable() {
+    return isNonNative() && 
getStorageHandler().toString().equals(Constants.DRUID_HIVE_STORAGE_HANDLER_ID);
+  }
+  
+  public boolean isJdbcTable() {
+    return isNonNative() && 
getStorageHandler().toString().equals(Constants.JDBC_HIVE_STORAGE_HANDLER_ID);
+  }

Review Comment:
   For #1, I can add a null check like before.
   
   > Could you please share how this refactor is related to collecting the 
virtual columns?
   Wrong virtual columns were being added because `obtainTableType` was 
incorrectly classifying iceberg tables as NATIVE. So I wanted to remove/fix the 
method. Moreover, I noticed that the enum `TableType` is only used in a very 
few places, and was only returned by this method `obtainTableType`. If we 
remove the method, then there's no real reason to keep the enum.
   
   So I decided to move the table type logic like:
   ```
   if (storageHandlerStr
               .equals(Constants.DRUID_HIVE_STORAGE_HANDLER_ID)) {
             return TableType.DRUID;
           }
   ```
   to their respective methods in Table.java. I thought this was a better way 
because we already have methods like `isNonNative` in Table.java.
   
   While this is strictly not needed for collecting virtual columns, I thought 
obtainTableType and enum TableType are really not needed, and decided to remove 
them. Let me know if you want me to revert these changes or move them somewhere 
else. I will add a null check if we decide to keep them here.



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