Return-Path: X-Original-To: apmail-hive-user-archive@www.apache.org Delivered-To: apmail-hive-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7D3EE9857 for ; Fri, 31 Aug 2012 15:51:20 +0000 (UTC) Received: (qmail 77178 invoked by uid 500); 31 Aug 2012 15:51:19 -0000 Delivered-To: apmail-hive-user-archive@hive.apache.org Received: (qmail 77092 invoked by uid 500); 31 Aug 2012 15:51:19 -0000 Mailing-List: contact user-help@hive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@hive.apache.org Delivered-To: mailing list user@hive.apache.org Received: (qmail 77083 invoked by uid 99); 31 Aug 2012 15:51:19 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 31 Aug 2012 15:51:19 +0000 X-ASF-Spam-Status: No, hits=0.0 required=5.0 tests=FSL_RCVD_USER,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of prvs=mgrover=583e8e236@oanda.com designates 98.158.95.75 as permitted sender) Received: from [98.158.95.75] (HELO ironport-01.sms.scalar.ca) (98.158.95.75) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 31 Aug 2012 15:51:12 +0000 Received: from unknown (HELO sms-zimbra-mta-02.sms.scalar.ca) ([192.168.32.56]) by ironport-01.sms.scalar.ca with ESMTP; 31 Aug 2012 11:50:50 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by sms-zimbra-mta-02.sms.scalar.ca (Postfix) with ESMTP id D5C3587C0B for ; Fri, 31 Aug 2012 11:50:50 -0400 (EDT) Received: from sms-zimbra-mta-02.sms.scalar.ca ([127.0.0.1]) by localhost (sms-zimbra-mta-02.sms.scalar.ca [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id E9DJmurzBgtg for ; Fri, 31 Aug 2012 11:50:50 -0400 (EDT) Received: from sms-zimbra-message-store-03.sms.scalar.ca (unknown [172.17.19.202]) by sms-zimbra-mta-02.sms.scalar.ca (Postfix) with ESMTP id ADA7587BDC for ; Fri, 31 Aug 2012 11:50:50 -0400 (EDT) Date: Fri, 31 Aug 2012 11:50:50 -0400 (EDT) From: Mark Grover To: user@hive.apache.org Message-ID: <1675749989.444768.1346428250611.JavaMail.root@sms-zimbra-message-store-03.sms.scalar.ca> In-Reply-To: Subject: Re: A question about HiveStatement.executeUpdate's exception MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [216.235.10.210] X-Mailer: Zimbra 7.1.2_GA_3268 (ZimbraWebClient - SAF3 (Linux)/7.1.2_GA_3268) Hi Liyifan, This seems like a bug. As a workaround, I would recommend using HiveStatement.executeQuery() instead (since they both call execute() on the Thrift client). There is a JIRA already for this (https://issues.apache.org/jira/browse/HIVE-1450) and seems like a patch was uploaded as well (https://reviews.facebook.net/D4293) but nothing has been committed just yet. I've asked for the status on the JIRA, let's see what they say:-) Mark ----- Original Message ----- From: "Liyifan" To: user@hive.apache.org Sent: Tuesday, August 28, 2012 9:47:37 PM Subject: A question about HiveStatement.executeUpdate's exception Hi, all. I'm new to Hive, I have a question about executeUpdate. I executed a SQL by invoking HiveStatement.executeUpdate method. I found that it throws an "Method not supported" exception. And I checked the code in hive-0.9\jdbc\src\java\org\apache\hadoop\hive\jdbc\HiveStatement.java, I found that the "Method not supported" is always threw unless client.execute(sql) throws an exceptioin. I'm confused about it, why executeUpdate always throws an exeption? public int executeUpdate(String sql) throws SQLException { try { client.execute(sql); } catch (Exception ex) { throw new SQLException(ex.toString()); } throw new SQLException("Method not supported"); }