Return-Path: Delivered-To: apmail-hadoop-hive-dev-archive@minotaur.apache.org Received: (qmail 88496 invoked from network); 2 Nov 2009 20:15:22 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 2 Nov 2009 20:15:22 -0000 Received: (qmail 21708 invoked by uid 500); 2 Nov 2009 20:15:22 -0000 Delivered-To: apmail-hadoop-hive-dev-archive@hadoop.apache.org Received: (qmail 21641 invoked by uid 500); 2 Nov 2009 20:15:22 -0000 Mailing-List: contact hive-dev-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hive-dev@hadoop.apache.org Delivered-To: mailing list hive-dev@hadoop.apache.org Received: (qmail 21630 invoked by uid 99); 2 Nov 2009 20:15:22 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Nov 2009 20:15:22 +0000 X-ASF-Spam-Status: No, hits=-10.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Nov 2009 20:15:19 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 79C5A234C498 for ; Mon, 2 Nov 2009 12:14:59 -0800 (PST) Message-ID: <1363196645.1257192899497.JavaMail.jira@brutus> Date: Mon, 2 Nov 2009 20:14:59 +0000 (UTC) From: "Zheng Shao (JIRA)" To: hive-dev@hadoop.apache.org Subject: [jira] Commented: (HIVE-902) cli.sh can not correctly identify Hadoop minor version numbers less than 20 In-Reply-To: <1139342391.1256523299705.JavaMail.jira@brutus> 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-902?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12772641#action_12772641 ] Zheng Shao commented on HIVE-902: --------------------------------- Please replace [0-9]+ with [[:digit:]]+ in the previous comment - that was for debugging. > cli.sh can not correctly identify Hadoop minor version numbers less than 20 > --------------------------------------------------------------------------- > > Key: HIVE-902 > URL: https://issues.apache.org/jira/browse/HIVE-902 > Project: Hadoop Hive > Issue Type: Bug > Reporter: Carl Steinbach > Assignee: Carl Steinbach > Fix For: 0.4.1, 0.5.0 > > Attachments: HIVE-902.1.patch, HIVE-902.2.patch > > > cli.sh uses the following logic to detect the version of hadoop: > version=$($HADOOP version | awk '{print $2;}'); > if [[ $version =~ "^0\.17" ]] || [[ $version =~ "^0\.18" ]] || [[ $version =~ "^0.19" ]]; then > exec $HADOOP jar $AUX_JARS_CMD_LINE ${HIVE_LIB}/hive_cli.jar $CLASS $HIVE_OPTS "$@" > else > # hadoop 20 or newer - skip the aux_jars option. picked up from hiveconf > exec $HADOOP jar ${HIVE_LIB}/hive_cli.jar $CLASS $HIVE_OPTS "$@" > fi > Apparently bash doesn't expect you to quote the regex: > % ./bash -version > GNU bash, version 4.0.0(1)-release (i386-apple-darwin9.8.0) > % hadoop version > Hadoop 0.19.0 > Subversion https://svn.apache.org/repos/asf/hadoop/core/branches/branch-0.19 -r 713890 > Compiled by ndaley on Fri Nov 14 03:12:29 UTC 2008 > % version=$(hadoop version | awk '{print $2;}') > % echo $version > 0.19.0 https://svn.apache.org/repos/asf/hadoop/core/branches/branch-0.19 by > % [[ $version =~ "^0\.19" ]] && echo "Yes" || echo "No" > No > % [[ $version =~ "^0.19" ]] && echo "Yes" || echo "No" > No > % [[ $version =~ ^0.19 ]] && echo "Yes" || echo "No" > Yes -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.