Skip to content

Commit

Permalink
HIVE-1817. Remove Hive dependency on unreleased commons-cli 2.0 Snapshot
Browse files Browse the repository at this point in the history
(Carl Steinbach via jvs)



git-svn-id: https://svn.apache.org/repos/asf/hive/branches/branch-0.7@1071351 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
John Sichi committed Feb 16, 2011
1 parent 8b5031b commit 809979a
Show file tree
Hide file tree
Showing 20 changed files with 282 additions and 322 deletions.
20 changes: 17 additions & 3 deletions bin/ext/cli.sh
@@ -1,3 +1,18 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

THISSERVICE=cli
export SERVICE_LIST="${SERVICE_LIST}${THISSERVICE} "

Expand All @@ -7,8 +22,7 @@ cli () {
}

cli_help () {
echo "usage ./hive [-e 'hql'| -f file ] "
echo " -e 'hwl' : execute specified query"
echo " -f file : exeute query in file"
CLASS=org.apache.hadoop.hive.cli.CliDriver
execHiveCmd $CLASS "--help"
}

15 changes: 15 additions & 0 deletions bin/ext/help.sh
@@ -1,3 +1,18 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

THISSERVICE=help
export SERVICE_LIST="${SERVICE_LIST}${THISSERVICE} "

Expand Down
40 changes: 17 additions & 23 deletions bin/ext/hiveserver.sh
@@ -1,3 +1,18 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

THISSERVICE=hiveserver
export SERVICE_LIST="${SERVICE_LIST}${THISSERVICE} "

Expand All @@ -9,29 +24,8 @@ hiveserver() {
fi
JAR=${HIVE_LIB}/hive-service-*.jar

version=$($HADOOP version | awk '{if (NR == 1) {print $2;}}');

# Save the regex to a var to workaround quoting incompatabilities
# between Bash 3.1 and 3.2
version_re="^([[:digit:]]+)\.([[:digit:]]+)(\.([[:digit:]]+))?.*$"

if [[ "$version" =~ $version_re ]]; then
major_ver=${BASH_REMATCH[1]}
minor_ver=${BASH_REMATCH[2]}
patch_ver=${BASH_REMATCH[4]}
else
echo "Unable to determine Hadoop version information."
echo "'hadoop version' returned:"
echo `$HADOOP version`
exit 6
fi

if [ $minor_ver -lt 20 ]; then
exec $HADOOP jar $AUX_JARS_CMD_LINE $JAR $CLASS $HIVE_PORT "$@"
else
# hadoop 20 or newer - skip the aux_jars option and hiveconf
exec $HADOOP jar $JAR $CLASS $HIVE_PORT "$@"
fi
# hadoop 20 or newer - skip the aux_jars option and hiveconf
exec $HADOOP jar $JAR $CLASS $HIVE_PORT "$@"
}

hiveserver_help() {
Expand Down
41 changes: 17 additions & 24 deletions bin/ext/hwi.sh
@@ -1,3 +1,18 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

THISSERVICE=hwi
export SERVICE_LIST="${SERVICE_LIST}${THISSERVICE} "

Expand All @@ -24,32 +39,10 @@ hwi() {
HADOOP_CLASSPATH=${HADOOP_CLASSPATH}:$f
done

version=$($HADOOP version | awk '{if (NR == 1) {print $2;}}');
# Save the regex to a var to workaround quoting incompatabilities
# between Bash 3.1 and 3.2
version_re="^([[:digit:]]+)\.([[:digit:]]+)(\.([[:digit:]]+))?.*$"

if [[ "$version" =~ $version_re ]]; then
major_ver=${BASH_REMATCH[1]}
minor_ver=${BASH_REMATCH[2]}
patch_ver=${BASH_REMATCH[4]}
else
echo "Unable to determine Hadoop version information."
echo "'hadoop version' returned:"
echo `$HADOOP version`
exit 6
fi

export HADOOP_CLASSPATH

if [ $minor_ver -lt 20 ]; then
exec $HADOOP jar $AUX_JARS_CMD_LINE ${HWI_JAR_FILE} $CLASS $HIVE_OPTS "$@"
else
# hadoop 20 or newer - skip the aux_jars option and hiveconf
exec $HADOOP jar ${HWI_JAR_FILE} $CLASS $HIVE_OPTS "$@"
fi
#nohup $HADOOP jar $AUX_JARS_CMD_LINE ${HWI_JAR_FILE} $CLASS $HIVE_OPTS "$@" >/dev/null 2>/dev/null &

# hadoop 20 or newer - skip the aux_jars option and hiveconf
exec $HADOOP jar ${HWI_JAR_FILE} $CLASS $HIVE_OPTS "$@"
}

hwi_help(){
Expand Down
25 changes: 2 additions & 23 deletions bin/ext/jar.sh
Expand Up @@ -27,23 +27,6 @@ jar () {
HIVE_LIB=`cygpath -w "$HIVE_LIB"`
fi

version=$($HADOOP version | awk '{if (NR == 1) {print $2;}}');

# Save the regex to a var to workaround quoting incompatabilities
# between Bash 3.1 and 3.2
version_re="^([[:digit:]]+)\.([[:digit:]]+)(\.([[:digit:]]+))?.*$"

if [[ "$version" =~ $version_re ]]; then
major_ver=${BASH_REMATCH[1]}
minor_ver=${BASH_REMATCH[2]}
patch_ver=${BASH_REMATCH[4]}
else
echo "Unable to determine Hadoop version information."
echo "'hadoop version' returned:"
echo `$HADOOP version`
exit 6
fi

if [ -z "$RUNJAR" ] ; then
echo "RUNJAR not specified"
exit 3
Expand All @@ -54,12 +37,8 @@ jar () {
exit 3
fi

if [ $minor_ver -lt 20 ]; then
exec $HADOOP jar $AUX_JARS_CMD_LINE $RUNJAR $RUNCLASS $HIVE_OPTS "$@"
else
# hadoop 20 or newer - skip the aux_jars option and hiveconf
exec $HADOOP jar $RUNJAR $RUNCLASS $HIVE_OPTS "$@"
fi
# hadoop 20 or newer - skip the aux_jars option and hiveconf
exec $HADOOP jar $RUNJAR $RUNCLASS $HIVE_OPTS "$@"
}

jar_help () {
Expand Down
40 changes: 17 additions & 23 deletions bin/ext/metastore.sh
@@ -1,3 +1,18 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

THISSERVICE=metastore
export SERVICE_LIST="${SERVICE_LIST}${THISSERVICE} "

Expand All @@ -9,29 +24,8 @@ metastore() {
fi
JAR=${HIVE_LIB}/hive-service-*.jar

version=$($HADOOP version | awk '{if (NR == 1) {print $2;}}');

# Save the regex to a var to workaround quoting incompatabilities
# between Bash 3.1 and 3.2
version_re="^([[:digit:]]+)\.([[:digit:]]+)(\.([[:digit:]]+))?.*$"

if [[ "$version" =~ $version_re ]]; then
major_ver=${BASH_REMATCH[1]}
minor_ver=${BASH_REMATCH[2]}
patch_ver=${BASH_REMATCH[4]}
else
echo "Unable to determine Hadoop version information."
echo "'hadoop version' returned:"
echo `$HADOOP version`
exit 6
fi

if [ $minor_ver -lt 20 ]; then
exec $HADOOP jar $AUX_JARS_CMD_LINE $JAR $CLASS $METASTORE_PORT "$@"
else
# hadoop 20 or newer - skip the aux_jars option and hiveconf
exec $HADOOP jar $JAR $CLASS $METASTORE_PORT "$@"
fi
# hadoop 20 or newer - skip the aux_jars option and hiveconf
exec $HADOOP jar $JAR $CLASS $METASTORE_PORT "$@"
}

metastore_help() {
Expand Down
15 changes: 15 additions & 0 deletions bin/ext/rcfilecat.sh
@@ -1,3 +1,18 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

THISSERVICE=rcfilecat
export SERVICE_LIST="${SERVICE_LIST}${THISSERVICE} "

Expand Down
41 changes: 17 additions & 24 deletions bin/ext/util/execHiveCmd.sh
@@ -1,3 +1,18 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

execHiveCmd () {
CLASS=$1;
shift;
Expand All @@ -12,28 +27,6 @@ execHiveCmd () {
HIVE_LIB=`cygpath -w "$HIVE_LIB"`
fi

version=$($HADOOP version | awk '{if (NR == 1) {print $2;}}');

# Save the regex to a var to workaround quoting incompatabilities
# between Bash 3.1 and 3.2
version_re="^([[:digit:]]+)\.([[:digit:]]+)(\.([[:digit:]]+))?.*$"

if [[ "$version" =~ $version_re ]]; then
major_ver=${BASH_REMATCH[1]}
minor_ver=${BASH_REMATCH[2]}
patch_ver=${BASH_REMATCH[4]}
else
echo "Unable to determine Hadoop version information."
echo "'hadoop version' returned:"
echo `$HADOOP version`
exit 6
fi

if [ $minor_ver -lt 20 ]; 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

# hadoop 20 or newer - skip the aux_jars option. picked up from hiveconf
exec $HADOOP jar ${HIVE_LIB}/hive-cli-*.jar $CLASS $HIVE_OPTS "$@"
}
27 changes: 26 additions & 1 deletion bin/hive
Expand Up @@ -155,6 +155,31 @@ if [ ! -f ${HADOOP} ]; then
exit 4;
fi

# Make sure we're using a compatible version of Hadoop
hadoop_version=$($HADOOP version | awk '{if (NR == 1) {print $2;}}');

# Save the regex to a var to workaround quoting incompatabilities
# between Bash 3.1 and 3.2
hadoop_version_re="^([[:digit:]]+)\.([[:digit:]]+)(\.([[:digit:]]+))?.*$"

if [[ "$hadoop_version" =~ $hadoop_version_re ]]; then
hadoop_major_ver=${BASH_REMATCH[1]}
hadoop_minor_ver=${BASH_REMATCH[2]}
hadoop_patch_ver=${BASH_REMATCH[4]}
else
echo "Unable to determine Hadoop version information."
echo "'hadoop version' returned:"
echo `$HADOOP version`
exit 5
fi

if [ $hadoop_minor_ver -ne 20 -o $hadoop_patch_ver -eq 0 ]; then
echo "Hive requires Hadoop 0.20.x (x >= 1)."
echo "'hadoop version' returned:"
echo `$HADOOP version`
exit 6
fi

if [ "${AUX_PARAM}" != "" ]; then
HIVE_OPTS="$HIVE_OPTS -hiveconf hive.aux.jars.path=${AUX_PARAM}"
AUX_JARS_CMD_LINE="-libjars ${AUX_PARAM}"
Expand All @@ -180,7 +205,7 @@ done
if [ "$TORUN" = "" ] ; then
echo "Service $SERVICE not found"
echo "Available Services: $SERVICE_LIST"
exit 5
exit 7
else
$TORUN "$@"
fi
1 change: 0 additions & 1 deletion bin/hive-config.sh
@@ -1,4 +1,3 @@

# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
Expand Down
2 changes: 1 addition & 1 deletion build.properties
Expand Up @@ -10,7 +10,7 @@ javac.deprecation=off
javac.args=
javac.args.warnings=

hadoop.version=0.20.0
hadoop.version=0.20.1
hadoop.mirror=http://mirror.facebook.net/facebook/hive-deps

build.dir.hive=${hive.root}/build
Expand Down
2 changes: 1 addition & 1 deletion build.xml
Expand Up @@ -206,7 +206,7 @@
</antcall>
<for keepgoing="${test.continue.on.failure}" param="file">
<path>
<fileset dir="." includes="*/build.xml" excludes="ant/*,odbc/*"/>
<fileset dir="." includes="*/build.xml" excludes="ant/*,odbc/*,shims/*"/>
</path>
<sequential>
<ant antfile="@{file}" target="test" inheritAll="false" inheritRefs="true">
Expand Down
14 changes: 14 additions & 0 deletions cli/build.xml
Expand Up @@ -27,6 +27,20 @@ to call at top-level: ant deploy-contrib compile-core-test
<property name="src.dir" location="${basedir}/src/java"/>
<import file="../build-common.xml"/>

<target name="compile" depends="init, setup, ivy-retrieve">
<echo message="Compiling: ${ant.project.name}"/>
<javac
encoding="${build.encoding}"
srcdir="${src.dir}"
includes="**/*.java"
destdir="${build.classes}"
debug="${javac.debug}"
deprecation="${javac.deprecation}">
<compilerarg line="${javac.args} ${javac.args.warnings}" />
<classpath refid="classpath"/>
</javac>
</target>

<target name="test">
<echo message="Nothing to do!"/>
</target>
Expand Down

0 comments on commit 809979a

Please sign in to comment.