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


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/dataconnector/jdbc/HiveJDBCConnectorProvider.java:
##########
@@ -0,0 +1,100 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+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.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.sql.ResultSet;
+import java.sql.SQLException;
+
+public class HiveJDBCConnectorProvider extends AbstractJDBCConnectorProvider {
+  private static Logger LOG = 
LoggerFactory.getLogger(HiveJDBCConnectorProvider.class);
+
+  private static final String DRIVER_CLASS = 
"org.apache.hive.jdbc.HiveDriver".intern();
+
+  public HiveJDBCConnectorProvider(String dbName, DataConnector dataConn) {
+    super(dbName, dataConn, 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 MetaException 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);
+    }
+    return rs;
+  }
+
+  /**
+   * Fetch a single table with the given name, returns a Hive Table object 
from the remote database
+   * @return Table A Table object for the matching table, null otherwise.
+   * @throws MetaException To indicate any failures with executing this API
+   * @param tableName
+   */
+  @Override public ResultSet fetchTableMetadata(String tableName) throws 
MetaException {

Review Comment:
   fixed



##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/dataconnector/jdbc/HiveJDBCConnectorProvider.java:
##########
@@ -0,0 +1,100 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+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.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.sql.ResultSet;
+import java.sql.SQLException;
+
+public class HiveJDBCConnectorProvider extends AbstractJDBCConnectorProvider {
+  private static Logger LOG = 
LoggerFactory.getLogger(HiveJDBCConnectorProvider.class);
+
+  private static final String DRIVER_CLASS = 
"org.apache.hive.jdbc.HiveDriver".intern();
+
+  public HiveJDBCConnectorProvider(String dbName, DataConnector dataConn) {
+    super(dbName, dataConn, 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 MetaException To indicate any failures with executing this API
+   */
+  @Override protected ResultSet fetchTableNames() throws MetaException {
+    ResultSet rs = null;

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.

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