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 78AD410AB0 for ; Tue, 17 Sep 2013 22:32:09 +0000 (UTC) Received: (qmail 11283 invoked by uid 500); 17 Sep 2013 22:31:58 -0000 Delivered-To: apmail-hive-dev-archive@hive.apache.org Received: (qmail 11185 invoked by uid 500); 17 Sep 2013 22:31:56 -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 11139 invoked by uid 500); 17 Sep 2013 22:31:55 -0000 Delivered-To: apmail-hadoop-hive-dev@hadoop.apache.org Received: (qmail 11096 invoked by uid 99); 17 Sep 2013 22:31:53 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Sep 2013 22:31:53 +0000 Date: Tue, 17 Sep 2013 22:31:52 +0000 (UTC) From: "Sergey Shelukhin (JIRA)" To: hive-dev@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (HIVE-5264) SQL generated by MetaStoreDirectSql.java not compliant with Postgres. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HIVE-5264?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Sergey Shelukhin updated HIVE-5264: ----------------------------------- Status: Patch Available (was: Open) > SQL generated by MetaStoreDirectSql.java not compliant with Postgres. > --------------------------------------------------------------------- > > Key: HIVE-5264 > URL: https://issues.apache.org/jira/browse/HIVE-5264 > Project: Hive > Issue Type: Bug > Components: Metastore > Affects Versions: 0.12.0 > Environment: Ubuntu 12.04 > PostgreSQL 9.1.8 > Reporter: Alexander Behm > Assignee: Sergey Shelukhin > Attachments: D12993.1.patch, HIVE-5264.patch > > > Some operations against the Hive Metastore seem broken > against Postgres. > For example, when using HiveMetastoreClient.listPartitions() > the Postgres logs show queries such as: > 2013-09-09 19:10:01 PDT STATEMENT: select PARTITIONS.PART_ID from > PARTITIONS inner join TBLS on PARTITIONS.TBL_ID = TBLS.TBL_ID inner > join DBS on TBLS.DB_ID = DBS.DB_ID where TBLS.TBL_NAME = $1 and > DBS.NAME = $2 order by PART_NAME asc > with a somewhat cryptic (but correct) error: > ERROR: relation "partitions" does not exist at character 32 > Postgres identifiers are somewhat unusual. Unquoted identifiers are interpreted as lower case (there is no Postgres option to change this). Since the Metastore table schema uses upper case table names, the correct SQL requires escaped identifiers to those tables, i.e., > select "PARTITIONS"."PART_ID" from "PARTITIONS"... > Hive sets metastore.try.direct.sql=true by default, so the above SQL is generated by hive/metastore/MetaStoreDirectSql.java, i.e., this is not a Datanucleus problem. > When I set metastore.try.direct.sql=false, then the Metastore backed by Postgres works. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira