hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From the...@apache.org
Subject svn commit: r1617838 - in /hive/trunk/jdbc/src/java/org/apache/hive/jdbc: HiveDatabaseMetaData.java HiveResultSetMetaData.java
Date Wed, 13 Aug 2014 21:08:36 GMT
Author: thejas
Date: Wed Aug 13 21:08:36 2014
New Revision: 1617838

URL: http://svn.apache.org/r1617838
Log:
HIVE-7676 : JDBC: Support more DatabaseMetaData, ResultSetMetaData methods (Alexander Pivovarov
via Thejas Nair)

Modified:
    hive/trunk/jdbc/src/java/org/apache/hive/jdbc/HiveDatabaseMetaData.java
    hive/trunk/jdbc/src/java/org/apache/hive/jdbc/HiveResultSetMetaData.java

Modified: hive/trunk/jdbc/src/java/org/apache/hive/jdbc/HiveDatabaseMetaData.java
URL: http://svn.apache.org/viewvc/hive/trunk/jdbc/src/java/org/apache/hive/jdbc/HiveDatabaseMetaData.java?rev=1617838&r1=1617837&r2=1617838&view=diff
==============================================================================
--- hive/trunk/jdbc/src/java/org/apache/hive/jdbc/HiveDatabaseMetaData.java (original)
+++ hive/trunk/jdbc/src/java/org/apache/hive/jdbc/HiveDatabaseMetaData.java Wed Aug 13 21:08:36
2014
@@ -339,7 +339,7 @@ public class HiveDatabaseMetaData implem
   }
 
   public String getIdentifierQuoteString() throws SQLException {
-    throw new SQLException("Method not supported");
+    return " ";
   }
 
   public ResultSet getImportedKeys(String catalog, String schema, String table)
@@ -383,7 +383,15 @@ public class HiveDatabaseMetaData implem
 
   public ResultSet getIndexInfo(String catalog, String schema, String table,
       boolean unique, boolean approximate) throws SQLException {
-    throw new SQLException("Method not supported");
+    return new HiveQueryResultSet.Builder(connection)
+        .setClient(client)
+        .setEmptyResultSet(true)
+        .setSchema(
+            Arrays.asList("TABLE_CAT", "TABLE_SCHEM", "TABLE_NAME", "NON_UNIQUE",
+                "INDEX_QUALIFIER", "INDEX_NAME", "TYPE", "ORDINAL_POSITION", "COLUMN_NAME",
+                "ASC_OR_DESC", "CARDINALITY", "PAGES", "FILTER_CONDITION"),
+            Arrays.asList("STRING", "STRING", "STRING", "BOOLEAN", "STRING", "STRING", "SHORT",
+                "SHORT", "STRING", "STRING", "INT", "INT", "STRING")).build();
   }
 
   public int getJDBCMajorVersion() throws SQLException {
@@ -920,7 +928,7 @@ public class HiveDatabaseMetaData implem
   }
 
   public boolean supportsFullOuterJoins() throws SQLException {
-    throw new SQLException("Method not supported");
+    return true;
   }
 
   public boolean supportsGetGeneratedKeys() throws SQLException {
@@ -948,7 +956,7 @@ public class HiveDatabaseMetaData implem
   }
 
   public boolean supportsLimitedOuterJoins() throws SQLException {
-    throw new SQLException("Method not supported");
+    return true;
   }
 
   public boolean supportsMinimumSQLGrammar() throws SQLException {
@@ -1034,7 +1042,7 @@ public class HiveDatabaseMetaData implem
   }
 
   public boolean supportsSchemasInDataManipulation() throws SQLException {
-    return false;
+    return true;
   }
 
   public boolean supportsSchemasInIndexDefinitions() throws SQLException {
@@ -1050,7 +1058,7 @@ public class HiveDatabaseMetaData implem
   }
 
   public boolean supportsSchemasInTableDefinitions() throws SQLException {
-    return false;
+    return true;
   }
 
   public boolean supportsSelectForUpdate() throws SQLException {
@@ -1099,11 +1107,11 @@ public class HiveDatabaseMetaData implem
   }
 
   public boolean supportsUnion() throws SQLException {
-    throw new SQLException("Method not supported");
+    return false;
   }
 
   public boolean supportsUnionAll() throws SQLException {
-    throw new SQLException("Method not supported");
+    return true;
   }
 
   public boolean updatesAreDetected(int type) throws SQLException {

Modified: hive/trunk/jdbc/src/java/org/apache/hive/jdbc/HiveResultSetMetaData.java
URL: http://svn.apache.org/viewvc/hive/trunk/jdbc/src/java/org/apache/hive/jdbc/HiveResultSetMetaData.java?rev=1617838&r1=1617837&r2=1617838&view=diff
==============================================================================
--- hive/trunk/jdbc/src/java/org/apache/hive/jdbc/HiveResultSetMetaData.java (original)
+++ hive/trunk/jdbc/src/java/org/apache/hive/jdbc/HiveResultSetMetaData.java Wed Aug 13 21:08:36
2014
@@ -130,7 +130,7 @@ public class HiveResultSetMetaData imple
   }
 
   public boolean isReadOnly(int column) throws SQLException {
-    throw new SQLException("Method not supported");
+    return true;
   }
 
   public boolean isSearchable(int column) throws SQLException {



Mime
View raw message