nrg4878 commented on a change in pull request #2037:
URL: https://github.com/apache/hive/pull/2037#discussion_r601860526
##########
File path:
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/dataconnector/jdbc/DerbySQLConnectorProvider.java
##########
@@ -0,0 +1,86 @@
+package org.apache.hadoop.hive.metastore.dataconnector.jdbc;
+
+import org.apache.hadoop.hive.metastore.ColumnType;
+import org.apache.hadoop.hive.metastore.api.DataConnector;
+import org.apache.hadoop.hive.metastore.api.MetaException;
+import org.apache.hadoop.hive.metastore.api.Table;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.List;
+
+public class DerbySQLConnectorProvider extends AbstractJDBCConnectorProvider {
+ private static Logger LOG =
LoggerFactory.getLogger(DerbySQLConnectorProvider.class);
+
+ // private static final String DRIVER_CLASS =
"org.apache.derby.jdbc.EmbeddedDriver".intern();
+ private static final String DRIVER_CLASS =
"org.apache.derby.jdbc.AutoloadedDriver".intern();
+
+ public DerbySQLConnectorProvider(String dbName, DataConnector connector) {
+ super(dbName, connector);
+ driverClassName = DRIVER_CLASS;
+ }
+
+ /**
+ * Returns a list of all table names from the remote database.
+ * @return List A collection of all the table names, null if there are no
tables.
+ * @throws IOException To indicate any failures with executing this API
+ */
+ @Override
+ protected ResultSet fetchTableNames() throws MetaException {
+ ResultSet rs = null;
+ try {
+ rs = getConnection().getMetaData().getTables(scoped_db, null, null, new
String[] { "TABLE" });
+ } catch (SQLException sqle) {
+ LOG.warn("Could not retrieve table names from remote datasource, cause:"
+ sqle.getMessage());
+ throw new MetaException("Could not retrieve table names from remote
datasource, cause:" + sqle.getMessage());
Review comment:
fixed.
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]