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 A03E5200CBF for ; Sat, 24 Jun 2017 02:24:05 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 9F2FC160BE5; Sat, 24 Jun 2017 00:24:05 +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 E5DD2160BF2 for ; Sat, 24 Jun 2017 02:24:04 +0200 (CEST) Received: (qmail 78276 invoked by uid 500); 24 Jun 2017 00:24:04 -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 78267 invoked by uid 99); 24 Jun 2017 00:24:04 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 24 Jun 2017 00:24:04 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 97397C2060 for ; Sat, 24 Jun 2017 00:24:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.211 X-Spam-Level: X-Spam-Status: No, score=-99.211 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id YCw3bEOJ_hxD for ; Sat, 24 Jun 2017 00:24:03 +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 AB8CD5F613 for ; Sat, 24 Jun 2017 00:24:02 +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 57005E0041 for ; Sat, 24 Jun 2017 00:24:02 +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 1F041240B7 for ; Sat, 24 Jun 2017 00:24:00 +0000 (UTC) Date: Sat, 24 Jun 2017 00:24:00 +0000 (UTC) From: "Gunther Hagleitner (JIRA)" To: issues@hive.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HIVE-16942) INFORMATION_SCHEMA: schematool for setting it up is not idempotent MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Sat, 24 Jun 2017 00:24:05 -0000 [ https://issues.apache.org/jira/browse/HIVE-16942?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16061684#comment-16061684 ] Gunther Hagleitner commented on HIVE-16942: ------------------------------------------- Patch fixes the problem described, but doesn't make the script idempotent. I'm not sure that's desirable because a non-empty sys db could indicate a problem (existing db). It's fine to drop an empty db though. [~thejas] review please? > INFORMATION_SCHEMA: schematool for setting it up is not idempotent > ------------------------------------------------------------------ > > Key: HIVE-16942 > URL: https://issues.apache.org/jira/browse/HIVE-16942 > Project: Hive > Issue Type: Bug > Affects Versions: 3.0.0 > Reporter: Carter Shanklin > Assignee: Gunther Hagleitner > Attachments: HIVE-16942.1.patch > > > If you run schematool to set up information schema, but the SYS database already exists, here's what happens: > {code} > [vagrant@trunk apache-hive-3.0.0-SNAPSHOT-bin]$ schematool -metaDbType mysql -dbType hive -initSchema -url jdbc:hive2://localhost:10000/default -driver org.apache.hive.jdbc.HiveDriver > Metastore connection URL: jdbc:hive2://localhost:10000/default > Metastore Connection Driver : org.apache.hive.jdbc.HiveDriver > Metastore connection User: hive > Starting metastore schema initialization to 3.0.0 > Initialization script hive-schema-3.0.0.hive.sql > Error: org.apache.hive.service.cli.HiveSQLException: Error while processing statement: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. Database SYS already exists > at org.apache.hive.service.cli.operation.Operation.toSQLException(Operation.java:315) > at org.apache.hive.service.cli.operation.SQLOperation.runQuery(SQLOperation.java:254) > {code} > Why is this a problem you ask? > If you run schematool without hive.metastore.db.type set (or set to the wrong thing), it will create the sys database but fail to create any of the tables within it. If you go and fix hive.metastore.db.type and re-run you'll get this failure until you drop the SYS database (which must be done as the hive user). > Can the init script use "create database if not exists sys" rather than just "create database sys"? -- This message was sent by Atlassian JIRA (v6.4.14#64029)