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 2019/04/02 17:52:26 UTC

[hive] branch master updated: HIVE-21377 : Using Oracle as HMS DB with DirectSQL (Rajkumar Singh via Vihang Karajgaonkar)

This is an automated email from the ASF dual-hosted git repository.

hashutosh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hive.git


The following commit(s) were added to refs/heads/master by this push:
     new f4c5dae  HIVE-21377 : Using Oracle as HMS DB with DirectSQL (Rajkumar Singh via Vihang Karajgaonkar)
f4c5dae is described below

commit f4c5dae1ed26cc592d0692e3123c182da6d4128c
Author: Rajkumar Singh <ra...@hortonworks.com>
AuthorDate: Tue Apr 2 10:51:32 2019 -0700

    HIVE-21377 : Using Oracle as HMS DB with DirectSQL (Rajkumar Singh via Vihang Karajgaonkar)
    
    Signed-off-by: Ashutosh Chauhan <ha...@apache.org>
---
 .../apache/hadoop/hive/metastore/MetastoreDirectSqlUtils.java    | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MetastoreDirectSqlUtils.java b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MetastoreDirectSqlUtils.java
index e476f8a..0d35fe4 100644
--- a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MetastoreDirectSqlUtils.java
+++ b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MetastoreDirectSqlUtils.java
@@ -516,6 +516,15 @@ class MetastoreDirectSqlUtils {
     if (value instanceof Boolean) {
       return (Boolean)value;
     }
+
+    // check if oracle db returned 0 or 1 for boolean value
+    if (value instanceof Number) {
+      try {
+        return BooleanUtils.toBooleanObject(Integer.valueOf(((Number) value).intValue()), 1, 0, null);
+      } catch (IllegalArgumentException iae) {
+        // NOOP
+      }
+    }
     if (value instanceof String) {
       try {
         return BooleanUtils.toBooleanObject((String) value, "Y", "N", null);