Return-Path: X-Original-To: apmail-hive-dev-archive@www.apache.org Delivered-To: apmail-hive-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B9060172FF for ; Sat, 4 Oct 2014 22:30:34 +0000 (UTC) Received: (qmail 93874 invoked by uid 500); 4 Oct 2014 22:30:34 -0000 Delivered-To: apmail-hive-dev-archive@hive.apache.org Received: (qmail 93804 invoked by uid 500); 4 Oct 2014 22:30:34 -0000 Mailing-List: contact dev-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 dev@hive.apache.org Received: (qmail 93793 invoked by uid 500); 4 Oct 2014 22:30:34 -0000 Delivered-To: apmail-hadoop-hive-dev@hadoop.apache.org Received: (qmail 93790 invoked by uid 99); 4 Oct 2014 22:30:34 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 04 Oct 2014 22:30:34 +0000 Date: Sat, 4 Oct 2014 22:30:34 +0000 (UTC) From: "Brock Noland (JIRA)" To: hive-dev@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (HIVE-8330) HiveResultSet.findColumn() parameters are case sensitive MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HIVE-8330?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:all-tabpanel ] Brock Noland updated HIVE-8330: ------------------------------- Release Note: HiveResultSet.findColumn() was case sensitive which is no= n-standard. This has been fixed. > HiveResultSet.findColumn() parameters are case sensitive > -------------------------------------------------------- > > Key: HIVE-8330 > URL: https://issues.apache.org/jira/browse/HIVE-8330 > Project: Hive > Issue Type: Bug > Affects Versions: 0.13.1 > Reporter: Sergio Pe=C3=B1a > Assignee: Sergio Pe=C3=B1a > Fix For: 0.15.0 > > Attachments: HIVE-8330.1.patch, HIVE-8330.2.patch, HIVE-8330.3.pa= tch, HIVE-8330.4.patch > > > Look at the following code: > {noformat} > Class.forName("org.apache.hive.jdbc.HiveDriver"); > Connection db =3D null; > Statement stmt =3D null; > ResultSet rs =3D null; > try { > db =3D DriverManager.getConnection("jdbc:hive2://localhost:10= 000/default", "hive", ""); > stmt =3D db.createStatement(); > rs =3D stmt.executeQuery("SELECT * FROM sample_07 limit 1"); > ResultSetMetaData metaData =3D rs.getMetaData(); > for (int i =3D 1; i <=3D metaData.getColumnCount(); i++) { > System.out.println("Column " + i + ": " + metaData.getCol= umnName(i)); > } > while (rs.next()) { > System.out.println(rs.findColumn("code")); > } > } finally { > DbUtils.closeQuietly(db, stmt, rs); > } > {noformat} > Above program will generate following result on my cluster: > {noformat} > Column 1: code > Column 2: description > Column 3: total_emp > Column 4: salary > 1 > {noformat} > However, if the last print sentence is changed as following (using upperc= ase characters): > {noformat} > System.out.println(rs.findColumn("Code")); > {noformat} > The program will fail at exactly that line. The same happens if the colum= n name is changed as "CODE" > Based on the JDBC ResultSet documentation, this method should be case ins= ensitive. > "Column names used as input to getter methods are case insensitive" > http://docs.oracle.com/javase/7/docs/api/java/sql/ResultSet.html -- This message was sent by Atlassian JIRA (v6.3.4#6332)