This is an automated email from the ASF dual-hosted git repository.

dengzh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hive.git


The following commit(s) were added to refs/heads/master by this push:
     new 28531941424 HIVE-29324: Remove the legacy Hadoop version check (#6195)
28531941424 is described below

commit 285319414243598808ae39c9090f2d9106ef596c
Author: dengzh <[email protected]>
AuthorDate: Thu Nov 20 14:58:48 2025 +0800

    HIVE-29324: Remove the legacy Hadoop version check (#6195)
---
 bin/hive                                           | 37 ----------------------
 .../metastore-server/src/main/scripts/base         | 35 --------------------
 2 files changed, 72 deletions(-)

diff --git a/bin/hive b/bin/hive
index fcd33c92cbc..41ba504d8a5 100755
--- a/bin/hive
+++ b/bin/hive
@@ -28,7 +28,6 @@ bin=`cd "$bin"; pwd`
 SERVICE=""
 HELP=""
 SKIP_HBASECP=false
-SKIP_HADOOPVERSION=false
 EXECUTE_WITH_JAVA=false
 
 SERVICE_ARGS=()
@@ -60,7 +59,6 @@ while [ $# -gt 0 ]; do
       shift
       ;;
     --skiphadoopversion)
-      SKIP_HADOOPVERSION=true
       shift
       ;;
     --skiphbasecp)
@@ -105,10 +103,6 @@ if [[ "$SERVICE" =~ 
^(help|version|orcfiledump|rcfilecat|schemaTool|cleardanglin
   SKIP_HBASECP=true
 fi
 
-if [[ "$SERVICE" =~ ^(help|schemaTool)$ ]] ; then
-  SKIP_HADOOPVERSION=true
-fi
-
 if [ -f "${HIVE_CONF_DIR}/hive-env.sh" ]; then
   . "${HIVE_CONF_DIR}/hive-env.sh"
 fi
@@ -298,37 +292,6 @@ if [ ! -f ${HADOOP} ]; then
   fi
 fi
 
-if [ "$EXECUTE_WITH_JAVA" == "false" ]; then
-  if [ "$SKIP_HADOOPVERSION" = false ]; then
-    # Make sure we're using a compatible version of Hadoop
-    if [ "x$HADOOP_VERSION" == "x" ]; then
-        HADOOP_VERSION=$($HADOOP version 2>&2 | awk -F"\t" '/Hadoop/ {print 
$0}' | cut -d' ' -f 2);
-    fi
-  
-    # 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_major_ver" -lt "1" -a  "$hadoop_minor_ver$hadoop_patch_ver" 
-lt "201" ]; then
-      echo "Hive requires Hadoop 0.20.x (x >= 1)."
-      echo "'hadoop version' returned:"
-      echo `$HADOOP version`
-      exit 6
-    fi
-  fi
-fi
-
 if [ "${AUX_PARAM}" != "" ]; then
   if [[ "$SERVICE" != beeline ]]; then
     HIVE_OPTS="$HIVE_OPTS --hiveconf hive.aux.jars.path=${AUX_PARAM}"
diff --git a/standalone-metastore/metastore-server/src/main/scripts/base 
b/standalone-metastore/metastore-server/src/main/scripts/base
index be90afd6e63..2cf72285d95 100755
--- a/standalone-metastore/metastore-server/src/main/scripts/base
+++ b/standalone-metastore/metastore-server/src/main/scripts/base
@@ -28,7 +28,6 @@ bin=`cd "$bin" 2>&1 > /dev/null; pwd`
 
 SERVICE=""
 HELP=""
-SKIP_HADOOPVERSION=false
 
 SERVICE_ARGS=()
 while [ $# -gt 0 ]; do
@@ -43,7 +42,6 @@ while [ $# -gt 0 ]; do
       shift
       ;;
     --skiphadoopversion)
-      SKIP_HADOOPVERSION=true
       shift
       ;;
     --help)
@@ -69,10 +67,6 @@ if [ "$SERVICE" = "" ] ; then
   fi
 fi
 
-if [[ "$SERVICE" =~ ^(help|schemaTool)$ ]] ; then
-  SKIP_HADOOPVERSION=true
-fi
-
 if [ -f "${METASTORE_CONF_DIR}/metastore-env.sh" ]; then
   . "${METASTORE_CONF_DIR}/metastore-env.sh"
 fi
@@ -167,35 +161,6 @@ if [ ! -f ${HADOOP} ]; then
   exit 4;
 fi
 
-if [ "$SKIP_HADOOPVERSION" = false ]; then
-  # Make sure we're using a compatible version of Hadoop
-  if [ "x$HADOOP_VERSION" == "x" ]; then
-      HADOOP_VERSION=$($HADOOP version 2>&2 | awk -F"\t" '/Hadoop/ {print $0}' 
| cut -d' ' -f 2);
-  fi
-  
-  # 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_major_ver" -lt "2" ] || [ "$hadoop_major_ver" -eq "2" -a 
"$hadoop_minor_ver" -lt "6" ]; then
-      echo "Standalone metastore requires Hadoop 2.6 or later."
-      echo "'hadoop version' returned:"
-      echo `$HADOOP version`
-      exit 6
-  fi
-fi
-
 if [ "${AUX_PARAM}" != "" ]; then
   METASTORE_OPTS="$METASTORE_OPTS --hiveconf hive.aux.jars.path=${AUX_PARAM}"
   AUX_JARS_CMD_LINE="-libjars ${AUX_PARAM}"

Reply via email to