Skip to content

Commit b6a0933

Browse files
kevincoxJoshRosen
authored andcommitted
[SPARK-10952] Only add hive to classpath if HIVE_HOME is set.
Currently if it isn't set it scans `/lib/*` and adds every dir to the classpath which makes the env too large and every command called afterwords fails. Author: Kevin Cox <[email protected]> Closes #8994 from kevincox/kevincox-only-add-hive-to-classpath-if-var-is-set.
1 parent 84f510c commit b6a0933

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

build/sbt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,12 @@
2020
# When creating new tests for Spark SQL Hive, the HADOOP_CLASSPATH must contain the hive jars so
2121
# that we can run Hive to generate the golden answer. This is not required for normal development
2222
# or testing.
23-
for i in "$HIVE_HOME"/lib/*
24-
do HADOOP_CLASSPATH="$HADOOP_CLASSPATH:$i"
25-
done
26-
export HADOOP_CLASSPATH
23+
if [ -n "$HIVE_HOME" ]; then
24+
for i in "$HIVE_HOME"/lib/*
25+
do HADOOP_CLASSPATH="$HADOOP_CLASSPATH:$i"
26+
done
27+
export HADOOP_CLASSPATH
28+
fi
2729

2830
realpath () {
2931
(

0 commit comments

Comments
 (0)