nrg4878 commented on code in PR #4475:
URL: https://github.com/apache/hive/pull/4475#discussion_r1286981612


##########
jdbc-handler/src/main/java/org/apache/hive/storage/jdbc/dao/HiveDatabaseAccessor.java:
##########
@@ -56,4 +57,19 @@ protected String addLimitToQuery(String sql, int limit) {
     }
     return sql + " LIMIT " + limit;
   }
+
+  @Override
+  protected List<String> getColNamesFromRS(ResultSet rs) throws Exception {
+    List<String> columnNames = super.getColNamesFromRS(rs);
+    return columnNames.stream()
+        .map(c -> {
+          int lastIndex = c.lastIndexOf(".");
+          return lastIndex == -1 ? c : c.substring(lastIndex + 1); })
+        .collect(Collectors.toList());
+  }
+
+  @Override
+  protected String getMetaDataQuery(String sql) {
+    return addLimitToQuery(sql, 0);

Review Comment:
   @akshat0395 Fair point about considering the change to limit 0 in the base 
code for all accessors. It think it would make sense if we are not doing 
anything with the first row of data. I also concur that it probably only adds 
significant overhead for hive.
   I am good with the plan of forking it off into another jira. I would also 
like some additional work in confirming that we are pushing down the predicates 
to these DBs. 
   @dengzhhu653  Can you create a follow up jira and merge this? 



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