You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by ha...@apache.org on 2018/04/07 03:29:14 UTC
hive git commit: HIVE-19121 : Fix HiveSchemaTool validation for
databases that don't support schema (Miklos Gergely via Ashutosh Chauhan)
Repository: hive
Updated Branches:
refs/heads/master 1417370ca -> a316c8203
HIVE-19121 : Fix HiveSchemaTool validation for databases that don't support schema (Miklos Gergely via Ashutosh Chauhan)
Signed-off-by: Ashutosh Chauhan <ha...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/a316c820
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/a316c820
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/a316c820
Branch: refs/heads/master
Commit: a316c8203275d38a0803fa319040123d6cfc7b21
Parents: 1417370
Author: Miklos Gergely <mg...@hortonworks.com>
Authored: Fri Apr 6 20:28:26 2018 -0700
Committer: Ashutosh Chauhan <ha...@apache.org>
Committed: Fri Apr 6 20:28:26 2018 -0700
----------------------------------------------------------------------
.../src/java/org/apache/hive/beeline/HiveSchemaTool.java | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hive/blob/a316c820/beeline/src/java/org/apache/hive/beeline/HiveSchemaTool.java
----------------------------------------------------------------------
diff --git a/beeline/src/java/org/apache/hive/beeline/HiveSchemaTool.java b/beeline/src/java/org/apache/hive/beeline/HiveSchemaTool.java
index 6a819da..a90127b 100644
--- a/beeline/src/java/org/apache/hive/beeline/HiveSchemaTool.java
+++ b/beeline/src/java/org/apache/hive/beeline/HiveSchemaTool.java
@@ -61,6 +61,7 @@ import java.sql.DatabaseMetaData;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
+import java.sql.SQLFeatureNotSupportedException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.Arrays;
@@ -739,9 +740,16 @@ public class HiveSchemaTool {
LOG.debug("Validating tables in the schema for version " + version);
try {
+ String schema = null;
+ try {
+ schema = hmsConn.getSchema();
+ } catch (SQLFeatureNotSupportedException e) {
+ LOG.debug("schema is not supported");
+ }
+
metadata = conn.getMetaData();
String[] types = {"TABLE"};
- rs = metadata.getTables(null, hmsConn.getSchema(), "%", types);
+ rs = metadata.getTables(null, schema, "%", types);
String table = null;
while (rs.next()) {