Return-Path: X-Original-To: apmail-hive-issues-archive@minotaur.apache.org Delivered-To: apmail-hive-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0AD7C10C3D for ; Sun, 10 May 2015 05:02:05 +0000 (UTC) Received: (qmail 13982 invoked by uid 500); 10 May 2015 05:02:00 -0000 Delivered-To: apmail-hive-issues-archive@hive.apache.org Received: (qmail 13964 invoked by uid 500); 10 May 2015 05:01:59 -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 13954 invoked by uid 99); 10 May 2015 05:01:59 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 10 May 2015 05:01:59 +0000 Date: Sun, 10 May 2015 05:01:59 +0000 (UTC) From: "Hive QA (JIRA)" To: issues@hive.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HIVE-10659) Beeline command which contains semi-colon as a non-command terminator will fail 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-10659?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14537029#comment-14537029 ] Hive QA commented on HIVE-10659: -------------------------------- {color:red}Overall{color}: -1 at least one tests failed Here are the results of testing the latest attachment: https://issues.apache.org/jira/secure/attachment/12731639/HIVE-10659.1.patch {color:red}ERROR:{color} -1 due to 3 failed/errored test(s), 8921 tests executed *Failed tests:* {noformat} org.apache.hadoop.hive.cli.TestCliDriver.testCliDriver_udaf_corr org.apache.hadoop.hive.cli.TestEncryptedHDFSCliDriver.testCliDriver_encryption_insert_partition_static org.apache.hadoop.hive.thrift.TestHadoop20SAuthBridge.testSaslWithHiveMetaStore {noformat} Test results: http://ec2-174-129-184-35.compute-1.amazonaws.com/jenkins/job/PreCommit-HIVE-TRUNK-Build/3836/testReport Console output: http://ec2-174-129-184-35.compute-1.amazonaws.com/jenkins/job/PreCommit-HIVE-TRUNK-Build/3836/console Test logs: http://ec2-174-129-184-35.compute-1.amazonaws.com/logs/PreCommit-HIVE-TRUNK-Build-3836/ Messages: {noformat} Executing org.apache.hive.ptest.execution.PrepPhase Executing org.apache.hive.ptest.execution.ExecutionPhase Executing org.apache.hive.ptest.execution.ReportingPhase Tests exited with: TestsFailedException: 3 tests failed {noformat} This message is automatically generated. ATTACHMENT ID: 12731639 - PreCommit-HIVE-TRUNK-Build > Beeline command which contains semi-colon as a non-command terminator will fail > ------------------------------------------------------------------------------- > > Key: HIVE-10659 > URL: https://issues.apache.org/jira/browse/HIVE-10659 > Project: Hive > Issue Type: Bug > Reporter: Hari Sankar Sivarama Subramaniyan > Assignee: Hari Sankar Sivarama Subramaniyan > Attachments: HIVE-10659.1.patch > > > Consider a scenario where beeline is used to connect to a mysql server. The commands executed via beeline can include stored procedures. For e.g. the following command used to create a stored procedure is a valid command : > {code} > CREATE PROCEDURE RM_TLBS_LINKID() BEGIN IF EXISTS (SELECT * FROM `INFORMATION_SCHEMA`.`COLUMNS` WHERE `TABLE_NAME` = 'TBLS' AND `COLUMN_NAME` = 'LINK_TARGET_ID') THEN ALTER TABLE `TBLS` DROP FOREIGN KEY `TBLS_FK3` ; ALTER TABLE `TBLS` DROP KEY `TBLS_N51` ; ALTER TABLE `TBLS` DROP COLUMN `LINK_TARGET_ID` ; END IF; END > {code} > MySQL stored procedures have semi-colon ( ; ) as the statement terminator. Since this coincides with beeline's only available command terminator, semi-colon, beeline will not able to execute the above command successfully . i.e, beeline tries to execute the below partial command instead of the complete command shown above. > {code} > CREATE PROCEDURE RM_TLBS_LINKID() BEGIN IF EXISTS (SELECT * FROM `INFORMATION_SCHEMA`.`COLUMNS` WHERE `TABLE_NAME` = 'TBLS' AND `COLUMN_NAME` = 'LINK_TARGET_ID') THEN ALTER TABLE `TBLS` DROP FOREIGN KEY `TBLS_FK3` ; > {code} > The above situation can actually happen within Hive when Hive SchemaTool is used to upgrade a mysql metastore db and the scripts used for the upgrade process contain stored procedures(as the one introduced initially by HIVE-7018). As of now, we cannot have any stored procedure as part of MySQL metastore db upgrade scripts because schemaTool uses beeline to connect to MySQL. As of now, beeline fails to execute any "create procedure" command or similar command containing ; . This is a serious limitation; it needs to be fixed by allowing the end user to provide an option to beeline to not use semi-colon as the command delimiter and instead use new line character as the command delimiter. -- This message was sent by Atlassian JIRA (v6.3.4#6332)