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 9724410D24 for ; Thu, 3 Apr 2014 18:33:30 +0000 (UTC) Received: (qmail 44680 invoked by uid 500); 3 Apr 2014 18:33:21 -0000 Delivered-To: apmail-hive-dev-archive@hive.apache.org Received: (qmail 44394 invoked by uid 500); 3 Apr 2014 18:33:19 -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 44233 invoked by uid 500); 3 Apr 2014 18:33:18 -0000 Delivered-To: apmail-hadoop-hive-dev@hadoop.apache.org Received: (qmail 44229 invoked by uid 99); 3 Apr 2014 18:33:18 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Apr 2014 18:33:18 +0000 Date: Thu, 3 Apr 2014 18:33:17 +0000 (UTC) From: "Xuefu Zhang (JIRA)" To: hive-dev@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HIVE-6561) Beeline should accept -i option to Initializing a SQL file 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-6561?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13959066#comment-13959066 ] Xuefu Zhang commented on HIVE-6561: ----------------------------------- While it's possible for Beeline to do some initialization w/o a connection, such as set color or execute a shell command (HIVE-6694), per my experience, init script for Hive is mostly used to control server behavior, such as loading jars or setting conf variables. Without a connection, these become meaningless. Hive CLI doesn't have the issue because a connection always exist, either embedded "server" or a remote server. Beeline can be started w/o either an embedded server or remote server, on the other hand. When I said "doing it after connection", I really meant "doing immediately WHEN the connection is made", which is the current Beeline behavior for variables that come either from connection string or command line. I'd propose that we execute additional commands specified in the init file whenever a connection is made. This is consistent with both Hive CLI and existing Beeline behavior. Under this proposal, client-side initialization is skipped w/o a connection, but I think we should be Okay: 1. most of time beeline will have a connection when started; 2. user can do "!run script.init" to execute a script file w/o a connection. > Beeline should accept -i option to Initializing a SQL file > ---------------------------------------------------------- > > Key: HIVE-6561 > URL: https://issues.apache.org/jira/browse/HIVE-6561 > Project: Hive > Issue Type: Improvement > Affects Versions: 0.10.0, 0.11.0, 0.12.0 > Reporter: Xuefu Zhang > Assignee: Navis > Attachments: HIVE-6561.1.patch.txt > > > Hive CLI has -i option. From Hive CLI help: > {code} > ... > -i Initialization SQL file > ... > {code} > However, Beeline has no such option: > {code} > xzhang@xzlt:~/apa/hive3$ ./packaging/target/apache-hive-0.14.0-SNAPSHOT-bin/apache-hive-0.14.0-SNAPSHOT-bin/bin/beeline -u jdbc:hive2:// -i hive.rc > ... > Connected to: Apache Hive (version 0.14.0-SNAPSHOT) > Driver: Hive JDBC (version 0.14.0-SNAPSHOT) > Transaction isolation: TRANSACTION_REPEATABLE_READ > -i (No such file or directory) > Property "url" is required > Beeline version 0.14.0-SNAPSHOT by Apache Hive > ... > {code} -- This message was sent by Atlassian JIRA (v6.2#6252)