deniskuzZ commented on code in PR #4902:
URL: https://github.com/apache/hive/pull/4902#discussion_r1615573796


##########
jdbc/src/java/org/apache/hive/jdbc/HiveResultSetMetaData.java:
##########
@@ -95,11 +99,23 @@ public int getScale(int column) throws SQLException {
   }
 
   public String getSchemaName(int column) throws SQLException {
-    throw new SQLFeatureNotSupportedException("Method not supported");
+    String tableName = getTableName(column);

Review Comment:
   use `HiveTableName.of(tableName).getDb()`



##########
jdbc/src/java/org/apache/hive/jdbc/HiveResultSetMetaData.java:
##########
@@ -95,11 +99,23 @@ public int getScale(int column) throws SQLException {
   }
 
   public String getSchemaName(int column) throws SQLException {
-    throw new SQLFeatureNotSupportedException("Method not supported");
+    String tableName = getTableName(column);
+    int index = tableName.lastIndexOf(DOT);
+    if (index >= 0) {
+      return tableName.substring(0, index);
+    }
+    // Impala usually doesn't return fully qualified column names. Return "" 
to avoid
+    // giving false results.
+    return "";
   }
 
   public String getTableName(int column) throws SQLException {
-    throw new SQLFeatureNotSupportedException("Method not supported");
+    String columnName = getColumnName(column);

Review Comment:
   same, use `HiveTableName.of(tableName).getTable()`



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