Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 749F8200C40 for ; Thu, 9 Mar 2017 04:33:45 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 733B7160B86; Thu, 9 Mar 2017 03:33:45 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id BA48E160B83 for ; Thu, 9 Mar 2017 04:33:44 +0100 (CET) Received: (qmail 66278 invoked by uid 500); 9 Mar 2017 03:33:43 -0000 Mailing-List: contact issues-help@hive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hive.apache.org Delivered-To: mailing list issues@hive.apache.org Received: (qmail 66269 invoked by uid 99); 9 Mar 2017 03:33:43 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Mar 2017 03:33:43 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 71BFE1A0724 for ; Thu, 9 Mar 2017 03:33:43 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.652 X-Spam-Level: X-Spam-Status: No, score=0.652 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-0.001, SPF_NEUTRAL=0.652, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id Qx5DV1_qDXo0 for ; Thu, 9 Mar 2017 03:33:41 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 8F2AC618B0 for ; Thu, 9 Mar 2017 03:33:40 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 586BCE00D9 for ; Thu, 9 Mar 2017 03:33:38 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 12B75243AA for ; Thu, 9 Mar 2017 03:33:38 +0000 (UTC) Date: Thu, 9 Mar 2017 03:33:38 +0000 (UTC) From: "Fei Hui (JIRA)" To: issues@hive.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HIVE-14804) HPLSQL multiple db connection does not switch back to Hive MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 09 Mar 2017 03:33:45 -0000 [ https://issues.apache.org/jira/browse/HIVE-14804?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15902422#comment-15902422 ] Fei Hui commented on HIVE-14804: -------------------------------- [~alangates] thanks for review and commit > HPLSQL multiple db connection does not switch back to Hive > ---------------------------------------------------------- > > Key: HIVE-14804 > URL: https://issues.apache.org/jira/browse/HIVE-14804 > Project: Hive > Issue Type: Bug > Components: hpl/sql > Reporter: Dmitry Kozlov > Assignee: Fei Hui > Priority: Blocker > Fix For: 2.0.2, 2.1.2 > > Attachments: HIVE-14804.1-branch-2.0.patch, HIVE-14804.1-branch-2.1.patch, HIVE-14804.2-branch-2.0.patch, HIVE-14804.2-branch-2.1.patch > > > I have a problem with a multi database connection. I have 3 environments that I would like to connect in my HPLSQL code Hive, DB2 and MySql. As soon as I map any table either from DB2 or MySQL my code stops to recognize Hive tables. Actually it starts to think that it is a table from the same database (DB2 or MySql) that was mapped the last. It means your example http://www.hplsql.org/map-object works only one way from Hive to MySQL and it is not possible to go back to Hive. > Here is a simple piece of code. > declare cnt int; > begin > /* > PRINT 'Start MySQL'; > MAP OBJECT tbls TO hive.TBLS AT mysqlconn; > select count(*) > into cnt > from tbls; > PRINT cnt; > PRINT 'Start Db2'; > MAP OBJECT exch TO DBDEV2.TEST_EXCHANGE AT db2conn; > select count(1) > into cnt > from exch; > PRINT cnt;*/ > PRINT 'Check Hive'; > SELECT count(1) > into cnt > FROM dev.test_sqoop; > PRINT cnt; > end; > It has three blocks. One select from MySQL, second from DB2 and third from Hive ORC table. > When first two blocks are commented then block 3 works. See below > Check Hive > 16/09/20 18:08:08 INFO jdbc.Utils: Supplied authorities: localhost:10000 > 16/09/20 18:08:08 INFO jdbc.Utils: Resolved authority: localhost:10000 > 16/09/20 18:08:08 INFO jdbc.HiveConnection: Will try to open client transport with JDBC Uri: jdbc:hive2://localhost:10000 > Open connection: jdbc:hive2://localhost:10000 (497 ms) > Starting query > Query executed successfully (177 ms) > 82 > When I try to uncomment any of those blocks then block 3 stops working. For example, if I uncomment block 1 I get this output. It is now assumes that dev.test_sqoop is a MySQL table. Contrarily to your example > Start MySQL > Open connection: jdbc:mysql://10.11.12.144:3306/hive (489 ms) > Starting query > Query executed successfully (4 ms) > 539 > Check Hive > Starting query > Unhandled exception in HPL/SQL > com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'dev.test_sqoop' doesn't exist > If I comment the second block then it starts to assume that dev.test_sqoop is a DB2 table. See below. So switch between DB2 and MySQL is working, however, the hive table is still not working > Start MySQL > Open connection: jdbc:mysql://10.11.12.144:3306/hive (485 ms) > Starting query > Query executed successfully (5 ms) > 539 > Start Db2 > Open connection: jdbc:db2://10.11.12.141:50000/WM (227 ms) > Starting query > Query executed successfully (48 ms) > 0 > Check Hive > Starting query > Unhandled exception in HPL/SQL > com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-204, SQLSTATE=42704, SQLERRMC=DEV.TEST_SQOOP, DRIVER=4.16.53 > Could you, please, provide your feedback on this finding. In addition, I would like to check if it would be possible to insert into a DB2 table records that were selected from a Hive with one statement as soon as DB2 table is properly mapped. Please, explain. > Looking forward to hearing from you soon. > Regards, > Dmitry Kozlov > Daisy Intelligence -- This message was sent by Atlassian JIRA (v6.3.15#6346)