Skip to content

Apache DataFusion SQL Query Engine

ARROW-7863: [C++][Python][CI] Ensure running HDFS related tests

Sutou Kouhei20410d04bd08
diff --git a/ci/docker/conda-python-hdfs.dockerfile b/ci/docker/conda-python-hdfs.dockerfile
index 3f45ee9d80..7c3a0a0266 100644
--- a/ci/docker/conda-python-hdfs.dockerfile
+++ b/ci/docker/conda-python-hdfs.dockerfile
@@ -23,9 +23,9 @@ FROM ${repo}:${arch}-conda-python-${python}
ARG jdk=8
ARG maven=3.5
RUN conda install -q \
- pandas \
+ maven=${maven} \
openjdk=${jdk} \
- maven=${maven} && \
+ pandas && \
conda clean --all
# installing libhdfs (JNI)
diff --git a/ci/scripts/integration_hdfs.sh b/ci/scripts/integration_hdfs.sh
index 9408425d0d..fab879fc11 100755
--- a/ci/scripts/integration_hdfs.sh
+++ b/ci/scripts/integration_hdfs.sh
@@ -22,20 +22,48 @@ set -e
source_dir=${1}/cpp
build_dir=${2}/cpp
-export CLASSPATH=`$HADOOP_HOME/bin/hadoop classpath --glob`
+export CLASSPATH=$($HADOOP_HOME/bin/hadoop classpath --glob)
export HADOOP_CONF_DIR=$HADOOP_HOME/etc/hadoop
export LIBHDFS3_CONF=$HADOOP_CONF_DIR/hdfs-site.xml
-export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HADOOP_HOME/lib/native/
+export ARROW_LIBHDFS3_DIR=$CONDA_PREFIX/lib
+
+libhdfs_dir=$HADOOP_HOME/lib/native
+hadoop_home=$HADOOP_HOME
+
+function use_hadoop_home() {
+ unset ARROW_LIBHDFS_DIR
+ export HADOOP_HOME=$hadoop_home
+}
+
+function use_libhdfs_dir() {
+ unset HADOOP_HOME
+ export ARROW_LIBHDFS_DIR=$libhdfs_dir
+}
# execute cpp tests
+export ARROW_HDFS_TEST_LIBHDFS_REQUIRE=ON
pushd ${build_dir}
+
+debug/arrow-io-hdfs-test
+debug/arrow-hdfs-test
+
+use_libhdfs_dir
debug/arrow-io-hdfs-test
debug/arrow-hdfs-test
+use_hadoop_home
+
popd
# cannot use --pyargs with custom arguments like --hdfs or --only-hdfs, because
# pytest ignores them, see https://github.com/pytest-dev/pytest/issues/3517
export PYARROW_TEST_HDFS=ON
+export PYARROW_HDFS_TEST_LIBHDFS_REQUIRE=ON
+
+pytest -v --pyargs pyarrow.tests.test_fs
+pytest -v --pyargs pyarrow.tests.test_hdfs
+
+use_libhdfs_dir
pytest -v --pyargs pyarrow.tests.test_fs
pytest -v --pyargs pyarrow.tests.test_hdfs
+use_hadoop_home