You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by jo...@apache.org on 2026/06/18 05:11:46 UTC

(impala) branch master updated (0b8294b1a -> 13d939457)

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

asf-gitbox-commits pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git


    from 0b8294b1a IMPALA-14702 (prep): Add an abstraction around malloc implementation details
     new e1391bcf8 IMPALA-15058: Fix incorrect server_name startup flag in Python scripts
     new cffe56518 IMPALA-15076: Fix JDBC scan duplication in UNION ALL and ResultSet race
     new 13d939457 IMPALA-14787: Add support for Redhat 10 and SLES 16

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 README.md                                          |   4 +-
 be/src/exec/data-source-scan-node.cc               |  16 ++--
 be/src/scheduling/scheduler-test-util.cc           |   2 +-
 be/src/scheduling/scheduler.cc                     |  98 +++++++++++++-------
 be/src/scheduling/scheduler.h                      |   6 +-
 bin/bootstrap_build.sh                             |   2 +-
 bin/bootstrap_system.sh                            |  81 ++++++++++++----
 bin/bootstrap_toolchain.py                         |   9 +-
 bin/impala-config-java.sh                          |  15 ++-
 bin/impala-config.sh                               |  12 +--
 bin/jenkins/all-tests.sh                           |   5 +-
 bin/nodejs/setup_nodejs.sh                         |   4 +-
 bin/run-all-tests.sh                               |   2 +-
 bin/start-impala-cluster.py                        |   4 +-
 buildall.sh                                        |   4 +-
 docker/CMakeLists.txt                              |  19 ++--
 .../extdatasource/jdbc/dao/JdbcRecordIterator.java |  27 +++++-
 .../org/apache/impala/planner/PlannerTest.java     |   6 +-
 .../queries/PlannerTest/jdbc-parallel.test         | 103 +++++++++++++++++++++
 tests/authorization/test_authorization.py          |  24 ++---
 tests/authorization/test_authorized_proxy.py       |   4 +-
 tests/authorization/test_provider.py               |   4 +-
 tests/authorization/test_ranger.py                 |   8 +-
 tests/custom_cluster/test_kill_query.py            |   4 +-
 tests/custom_cluster/test_otel_trace.py            |   8 +-
 tests/util/otel_trace.py                           |   5 +-
 26 files changed, 344 insertions(+), 132 deletions(-)


(impala) 03/03: IMPALA-14787: Add support for Redhat 10 and SLES 16

Posted by jo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

asf-gitbox-commits pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git

commit 13d93945788ba0888ccb77f502a3b12859e77e3e
Author: Joe McDonnell <jo...@cloudera.com>
AuthorDate: Fri Jun 12 21:26:15 2026 -0700

    IMPALA-14787: Add support for Redhat 10 and SLES 16
    
    This picks up a toolchain with Redhat 10 x86_64 support:
     - Redhat 10 only includes JDK 21 and above in the package
       repositories. This defaults to JDK 21 for Redhat 10.
       IMPALA-15108 is the epic to track full JDK 21 support.
       Initial tests didn't see any issues with JDK 21.
     - It modifies bin/bootstrap_system.sh to support Redhat 10.
       Redhat 10 doesn't have the same "family" structure for
       java alternatives, so it needs to specify the actual
       path instead. There are also differences in how to
       use the epel repository.
     - Redhat 10's "uname -p" returns "unknown" to be more POSIX
       compliant. We use this to detect ARM in several places, so
       this replaces "uname -p" with "uname -m" (machine), which
       provides equivalent functionality.
     - This drops logic for some unsupported distributions from
       our Docker image logic (Redhat 7, Ubuntu 16/18).
     - Since we applied a patch to opentelemetry-cpp, some OTEL tests
       that depend on that version number needed to change to
       either strip the patch number or accomodate it.
     - To make it easier to test new distributions, this changes the
       logic in bin/jenkins/all-tests.sh to only use ninja if the
       system has ninja.
    
    This has not tested SLES 16 yet. Redhat 10 ARM support will
    be added in IMPALA-15104.
    
    Testing:
     - Ran a core job on Redhat 10. It bootstraps and runs all the
       tests. There are a few failures that we'll need to address
       separately, but broadly, the job is functional.
     - Ran core job on Ubuntu 20
    
    Change-Id: I50acc5fbb4968e4310c4f84dde1d5b931b0385ec
    Reviewed-on: http://gerrit.cloudera.org:8080/24459
    Reviewed-by: Laszlo Gaal <la...@cloudera.com>
    Tested-by: Impala Public Jenkins <im...@cloudera.com>
---
 README.md                               |  4 +-
 bin/bootstrap_build.sh                  |  2 +-
 bin/bootstrap_system.sh                 | 81 +++++++++++++++++++++++++--------
 bin/bootstrap_toolchain.py              |  9 ++--
 bin/impala-config-java.sh               | 15 ++++--
 bin/impala-config.sh                    | 12 ++---
 bin/jenkins/all-tests.sh                |  5 +-
 bin/nodejs/setup_nodejs.sh              |  4 +-
 bin/run-all-tests.sh                    |  2 +-
 buildall.sh                             |  4 +-
 docker/CMakeLists.txt                   | 19 +++-----
 tests/custom_cluster/test_otel_trace.py |  8 ++--
 tests/util/otel_trace.py                |  5 +-
 13 files changed, 108 insertions(+), 62 deletions(-)

diff --git a/README.md b/README.md
index afc7f07b1..bae59ffb5 100644
--- a/README.md
+++ b/README.md
@@ -51,9 +51,9 @@ contains more detailed information on the minimum CPU requirements.
 Impala runs on Linux systems only. The supported distros are
 
 * Ubuntu 20.04/22.04/24.04
-* Rocky/RHEL 8/9
+* Rocky/RHEL 8/9/10
 
-Other systems, e.g. SLES15, may also be supported but are not tested by the community.
+Other systems, e.g. SLES15/16, may also be supported but are not tested by the community.
 
 ## Export Control Notice
 
diff --git a/bin/bootstrap_build.sh b/bin/bootstrap_build.sh
index 44b289515..aca168075 100755
--- a/bin/bootstrap_build.sh
+++ b/bin/bootstrap_build.sh
@@ -42,7 +42,7 @@ PACKAGES='g++ gcc git libsasl2-dev libssl-dev make ninja-build
 sudo -E apt-get --yes --quiet install ${PACKAGES}
 
 JDK_VERSION=17
-if [[ "$(uname -p)" == 'aarch64' ]]; then
+if [[ "$(uname -m)" == 'aarch64' ]]; then
   PACKAGE_ARCH='arm64'
 else
   PACKAGE_ARCH='amd64'
diff --git a/bin/bootstrap_system.sh b/bin/bootstrap_system.sh
index 653210c8a..8a87cdb7b 100755
--- a/bin/bootstrap_system.sh
+++ b/bin/bootstrap_system.sh
@@ -68,6 +68,7 @@ set -x
 REDHAT=
 REDHAT8=
 REDHAT9=
+REDHAT10=
 UBUNTU=
 UBUNTU20=
 UBUNTU22=
@@ -76,14 +77,17 @@ IN_DOCKER=
 if [[ -f /etc/redhat-release ]]; then
   REDHAT=true
   echo "Identified redhat system."
-  if grep 'release 9\.' /etc/redhat-release; then
+  if grep 'release 10\.' /etc/redhat-release; then
+    REDHAT10=true
+    echo "Identified redhat10 system."
+  elif grep 'release 9\.' /etc/redhat-release; then
     REDHAT9=true
     echo "Identified redhat9 system."
   elif grep 'release 8\.' /etc/redhat-release; then
     REDHAT8=true
     echo "Identified redhat8 system."
   else
-    echo "This script only supports Redhat releases 8 or 9 (or equivalents)."
+    echo "This script only supports Redhat releases 8, 9, or 10 (or equivalents)."
   fi
 else
   source /etc/lsb-release
@@ -157,12 +161,18 @@ function redhat8 {
     "$@"
   fi
 }
-# Helper function to execute following command only on RedHat8
+# Helper function to execute following command only on RedHat9
 function redhat9 {
   if [[ "$REDHAT9" == true ]]; then
     "$@"
   fi
 }
+# Helper function to execute following command only on RedHat10
+function redhat10 {
+  if [[ "$REDHAT10" == true ]]; then
+    "$@"
+  fi
+}
 # Helper function to execute following command only in docker
 function indocker {
   if [[ "$IN_DOCKER" == true ]]; then
@@ -176,7 +186,7 @@ function notindocker {
   fi
 }
 
-ARCH_NAME=$(uname -p)
+ARCH_NAME=$(uname -m)
 
 # X permission on home directory is needed for some uses of postgresql (IMPALA-13693)
 chmod o+X ~
@@ -231,17 +241,37 @@ redhat sudo yum install -y file gawk gcc gcc-c++ git krb5-devel krb5-server \
         krb5-workstation libevent-devel libffi-devel make openssl-devel cyrus-sasl \
         cyrus-sasl-gssapi cyrus-sasl-devel cyrus-sasl-plain \
         postgresql postgresql-server rpm-build \
-        wget vim-common nscd cmake zlib-devel \
+        wget vim-common cmake zlib-devel \
         procps psmisc lsof openssh-server \
         net-tools langpacks-en glibc-langpack-en libxml2-devel libxslt-devel \
         java-${REDHAT_JAVA_VERSION}-openjdk-src java-${REDHAT_JAVA_VERSION}-openjdk-devel
+# NSCD was removed in redhat10
+redhat8 sudo yum install -y nscd
+redhat9 sudo yum install -y nscd
+# We need Python >= 3.8, so Redhat 8 needs to manually specify a newer python
 redhat8 sudo yum install -y python38-devel python38-setuptools
 redhat9 sudo yum install -y python3-devel python3-setuptools
+redhat10 sudo yum install -y python3-devel python3-setuptools
+
+if [[ "$REDHAT10" == true ]] ; then
+  # Redhat 10 doesn't automatically create the alternatives family that we rely on
+  # below. Instead, this uses the paths directly.
+  sudo alternatives --set java /usr/lib/jvm/java-${REDHAT_JAVA_VERSION}-openjdk/bin/java
+  sudo alternatives --set javac \
+    /usr/lib/jvm/java-${REDHAT_JAVA_VERSION}-openjdk/bin/javac
+  sudo alternatives --set java_sdk_openjdk \
+    /usr/lib/jvm/java-${REDHAT_JAVA_VERSION}-openjdk
+  sudo alternatives --set jre_openjdk /usr/lib/jvm/java-${REDHAT_JAVA_VERSION}-openjdk
+elif [[ "$REDHAT" == true ]] ; then
+  # Redhat 8 and 9 have alternatives family settings (i.e. aliases that we can use
+  # rather than the path).
+  sudo alternatives --set java java-${REDHAT_JAVA_VERSION}-openjdk.${ARCH_NAME}
+  sudo alternatives --set javac java-${REDHAT_JAVA_VERSION}-openjdk.${ARCH_NAME}
+  sudo alternatives --set java_sdk_openjdk \
+    java-${REDHAT_JAVA_VERSION}-openjdk.${ARCH_NAME}
+  sudo alternatives --set jre_openjdk java-${REDHAT_JAVA_VERSION}-openjdk.${ARCH_NAME}
+fi
 
-redhat sudo alternatives --set java java-${REDHAT_JAVA_VERSION}-openjdk.${ARCH_NAME}
-redhat sudo alternatives --set javac java-${REDHAT_JAVA_VERSION}-openjdk.${ARCH_NAME}
-redhat sudo alternatives --set java_sdk_openjdk java-${REDHAT_JAVA_VERSION}-openjdk.${ARCH_NAME}
-redhat sudo alternatives --set jre_openjdk java-${REDHAT_JAVA_VERSION}-openjdk.${ARCH_NAME}
 redhat8 sudo alternatives --set python3 /usr/bin/python3.8
 
 # update-java-alternatives may not take effect if there is a Java in PATH
@@ -253,12 +283,28 @@ python3 --version
 
 # fuse-devel doesn't exist for Redhat 9
 redhat8 sudo yum install -y fuse-devel curl
-# Redhat9 can have curl-minimal preinstalled, which can conflict with curl.
+# Redhat 9 and 10 can have curl-minimal preinstalled, which can conflict with curl.
 # Adding --allowerasing allows curl to replace curl-minimal.
 redhat9 sudo yum install -y --allowerasing curl
+redhat10 sudo yum install -y --allowerasing curl
 
 # CentOS repos don't contain ccache, so install from EPEL
-redhat sudo yum install -y epel-release
+redhat8 sudo yum install -y epel-release
+redhat9 sudo yum install -y epel-release
+# Redhat 10 needs CRB to be enabled to install epel-release
+if [[ "$REDHAT10" == true ]] ; then
+  # RHEL has different steps from Rocky/Alma
+  if grep "Red Hat Enterprise Linux" /etc/redhat-release ; then
+    # On RHEL, CRB is done through the subscription manager, but some RHEL systems don't
+    # have repositories enabled. For now, just use the direct link.
+    sudo yum install -y \
+      https://dl.fedoraproject.org/pub/epel/epel-release-latest-10.noarch.rpm
+  else
+    sudo dnf -y install dnf-plugins-core
+    sudo dnf config-manager --enable crb
+    sudo dnf -y install epel-release
+  fi
+fi
 redhat sudo yum install -y ccache
 
 # Clean up yum caches
@@ -276,13 +322,11 @@ if [ ! -d "/usr/local/apache-maven-${MVN_VERSION}" ]; then
   # even if a previous version exists there.
   sudo ln -s -f "/usr/local/apache-maven-${MVN_VERSION}/bin/mvn" "/usr/local/bin"
 
-  # reset permissions on redhat8
-  # TODO: figure out why this is necessary for redhat8
+  # reset permissions on redhat
+  # TODO: figure out why this is necessary for redhat
   MAVEN_DIRECTORY="/usr/local/apache-maven-${MVN_VERSION}"
-  redhat8 indocker sudo chmod 0755 ${MAVEN_DIRECTORY}
-  redhat8 indocker sudo chmod 0755 ${MAVEN_DIRECTORY}/{bin,boot}
-  redhat9 indocker sudo chmod 0755 ${MAVEN_DIRECTORY}
-  redhat9 indocker sudo chmod 0755 ${MAVEN_DIRECTORY}/{bin,boot}
+  redhat indocker sudo chmod 0755 ${MAVEN_DIRECTORY}
+  redhat indocker sudo chmod 0755 ${MAVEN_DIRECTORY}/{bin,boot}
 fi
 
 if ! { service --status-all | grep -E '^ \[ \+ \]  ssh$'; }
@@ -418,8 +462,7 @@ echo -e "${USER} - memlock 65536" | sudo tee /etc/security/limits.d/10-memlock.c
 
 # Default on CentOS limits a user to 1024 or 4096 processes (threads) , which isn't
 # enough for minicluster with all of its friends.
-redhat8 echo -e "* soft nproc unlimited" | sudo tee -a /etc/security/limits.conf
-redhat9 echo -e "* soft nproc unlimited" | sudo tee -a /etc/security/limits.conf
+redhat echo -e "* soft nproc unlimited" | sudo tee -a /etc/security/limits.conf
 
 echo ">>> Checking out Impala"
 
diff --git a/bin/bootstrap_toolchain.py b/bin/bootstrap_toolchain.py
index 6d0e67fa8..2239c04c9 100755
--- a/bin/bootstrap_toolchain.py
+++ b/bin/bootstrap_toolchain.py
@@ -73,8 +73,6 @@ from string import Template
 # /etc/os-release files.
 OsMapping = namedtuple('OsMapping', ['release', 'toolchain'])
 OS_MAPPING = [
-  OsMapping("rhel7", "ec2-package-centos-7"),
-  OsMapping("centos7", "ec2-package-centos-7"),
   OsMapping("rhel8", "ec2-package-centos-8"),
   OsMapping("centos8", "ec2-package-centos-8"),
   OsMapping("rocky8", "ec2-package-centos-8"),
@@ -82,10 +80,11 @@ OS_MAPPING = [
   OsMapping("rhel9", "ec2-package-rocky-9"),
   OsMapping("rocky9", "ec2-package-rocky-9"),
   OsMapping("almalinux9", "ec2-package-rocky-9"),
-  OsMapping("sles12", "ec2-package-sles-12"),
+  OsMapping("rhel10", "ec2-package-rocky-10"),
+  OsMapping("rocky10", "ec2-package-rocky-10"),
+  OsMapping("almalinux10", "ec2-package-rocky-10"),
   OsMapping("sles15", "ec2-package-sles-15"),
-  OsMapping('ubuntu16', "ec2-package-ubuntu-16-04"),
-  OsMapping('ubuntu18', "ec2-package-ubuntu-18-04"),
+  OsMapping("sles16", "ec2-package-sles-16"),
   OsMapping('ubuntu20', "ec2-package-ubuntu-20-04"),
   OsMapping('ubuntu22', "ec2-package-ubuntu-22-04"),
   OsMapping('ubuntu24', "ec2-package-ubuntu-24-04")
diff --git a/bin/impala-config-java.sh b/bin/impala-config-java.sh
index 7f85f6bdc..7da884511 100644
--- a/bin/impala-config-java.sh
+++ b/bin/impala-config-java.sh
@@ -18,10 +18,17 @@
 IMPALA_JDK_VERSION=${IMPALA_JDK_VERSION:-}
 
 # Set OS Java package variables for bootstrap_system and Docker builds.
-# Defaults to installing Java 17.
+# Defaults to installing Java 17 on most platforms. This uses Java 21
+# for Redhat 10, as Redhat 10 only has Java 21 or above in its package
+# repositories.
 if [[ "${IMPALA_JDK_VERSION}" == "" ]]; then
-  UBUNTU_JAVA_VERSION=17
-  REDHAT_JAVA_VERSION=17
+  if grep -q -s 'release 10\.' /etc/redhat-release; then
+    REDHAT_JAVA_VERSION=21
+    UBUNTU_JAVA_VERSION=invalid
+  else
+    UBUNTU_JAVA_VERSION=17
+    REDHAT_JAVA_VERSION=17
+  fi
 elif [[ "${IMPALA_JDK_VERSION}" == "8" ]]; then
   UBUNTU_JAVA_VERSION=8
   REDHAT_JAVA_VERSION=1.8.0
@@ -30,7 +37,7 @@ else
   REDHAT_JAVA_VERSION="${IMPALA_JDK_VERSION}"
 fi
 
-if [[ "$(uname -p)" == 'aarch64' ]]; then
+if [[ "$(uname -m)" == 'aarch64' ]]; then
   UBUNTU_PACKAGE_ARCH='arm64'
 else
   UBUNTU_PACKAGE_ARCH='amd64'
diff --git a/bin/impala-config.sh b/bin/impala-config.sh
index 8cc2a31cf..6e4d3dbb5 100755
--- a/bin/impala-config.sh
+++ b/bin/impala-config.sh
@@ -81,13 +81,13 @@ export USE_AVRO_CPP=${USE_AVRO_CPP:=false}
 # moving to a different build of the toolchain, e.g. when a version is bumped or a
 # compile option is changed. The build id can be found in the output of the toolchain
 # build jobs, it is constructed from the build number and toolchain git hash prefix.
-export IMPALA_TOOLCHAIN_BUILD_ID_AARCH64=169-65bcf0ca99
-export IMPALA_TOOLCHAIN_BUILD_ID_X86_64=630-65bcf0ca99
+export IMPALA_TOOLCHAIN_BUILD_ID_AARCH64=177-d0713c535d
+export IMPALA_TOOLCHAIN_BUILD_ID_X86_64=640-d0713c535d
 export IMPALA_TOOLCHAIN_REPO=\
 ${IMPALA_TOOLCHAIN_REPO:-https://github.com/cloudera/native-toolchain.git}
 export IMPALA_TOOLCHAIN_BRANCH=${IMPALA_TOOLCHAIN_BRANCH:-master}
 export IMPALA_TOOLCHAIN_COMMIT_HASH=\
-${IMPALA_TOOLCHAIN_COMMIT_HASH-65bcf0ca99082360dffe1484425ec9a77e1212ca}
+${IMPALA_TOOLCHAIN_COMMIT_HASH-d0713c535d0beddaa5457e634c9e3a35d14bc92c}
 # Compare the build ref in build IDs by removing everything up-to-and-including the
 # first hyphen.
 if [ "${IMPALA_TOOLCHAIN_BUILD_ID_AARCH64#*-}" \
@@ -105,7 +105,7 @@ if [[ ! "$IMPALA_TOOLCHAIN_COMMIT_HASH" == "$TOOLCHAIN_SHORT_HASH"* ]]; then
   exit 1
 fi
 
-export ARCH_NAME=$(uname -p)
+export ARCH_NAME=$(uname -m)
 
 # Versions of toolchain dependencies.
 # -----------------------------------
@@ -157,7 +157,7 @@ export IMPALA_LLVM_VERSION=5.0.1-p8
 unset IMPALA_LLVM_URL
 export IMPALA_LLVM_ASAN_VERSION=5.0.1-p8
 unset IMPALA_LLVM_ASAN_URL
-export IMPALA_OPENTELEMETRY_CPP_VERSION=1.20.0
+export IMPALA_OPENTELEMETRY_CPP_VERSION=1.20.0-p1
 unset IMPALA_OPENTELEMTRY_CPP_URL
 
 # To limit maximum memory available for the mini-cluster and CDH cluster, add the
@@ -307,9 +307,9 @@ export IMPALA_PAIMON_VERSION=1.3.1
 # images (which have certain guarantees about maintenance, CVEs, etc).
 # These environment variables control the base images. They default to
 # free distributions, but Redhat UBI images are known to work.
-export IMPALA_REDHAT7_DOCKER_BASE=${IMPALA_REDHAT7_DOCKER_BASE:-"centos:centos7.9.2009"}
 export IMPALA_REDHAT8_DOCKER_BASE=${IMPALA_REDHAT8_DOCKER_BASE:-"rockylinux:8.5"}
 export IMPALA_REDHAT9_DOCKER_BASE=${IMPALA_REDHAT9_DOCKER_BASE:-"rockylinux:9.2"}
+export IMPALA_REDHAT10_DOCKER_BASE=${IMPALA_REDHAT10_DOCKER_BASE:-"rockylinux:10.2"}
 # Some users may want to use special, hardened base images for increased security.
 # These images are usually not related to the OS where the build is running.
 # The following environment variables allow a specific base image to be specified
diff --git a/bin/jenkins/all-tests.sh b/bin/jenkins/all-tests.sh
index b74da5545..bdfbadcab 100644
--- a/bin/jenkins/all-tests.sh
+++ b/bin/jenkins/all-tests.sh
@@ -31,8 +31,9 @@ export IMPALA_MAVEN_OPTIONS="-U"
 # Allow unlimited pytest failures
 export MAX_PYTEST_FAILURES=0
 
-# Use ninja for better link concurrency.
-export IMPALA_MAKE_CMD=ninja
+# Use ninja for better control over link concurrency. Allow overriding this for platforms
+# that don't install ninja.
+export IMPALA_MAKE_CMD=${IMPALA_MAKE_CMD:-ninja}
 
 # When UBSAN_FAIL is "death", the logs are monitored for UBSAN errors. Any errors will
 # then cause this script to exit.
diff --git a/bin/nodejs/setup_nodejs.sh b/bin/nodejs/setup_nodejs.sh
index 355a90284..8a48cf99d 100755
--- a/bin/nodejs/setup_nodejs.sh
+++ b/bin/nodejs/setup_nodejs.sh
@@ -21,7 +21,7 @@ set -euo pipefail
 . "$IMPALA_HOME/bin/report_build_error.sh"
 setup_report_build_error
 
-: ${ARCH_NAME:=$(uname -p)}
+: ${ARCH_NAME:=$(uname -m)}
 if [[ $ARCH_NAME == aarch64 ]]; then
   NODEJS_DISTRO=linux-arm64
 elif [[ $ARCH_NAME == x86_64 ]]; then
@@ -69,4 +69,4 @@ if [ ! -r "${IMPALA_NODEJS_LIB}/bin/node" ]; then
 fi;
 
 echo "NodeJS installation found in :"
-echo "${IMPALA_NODEJS_LIB}/bin"
\ No newline at end of file
+echo "${IMPALA_NODEJS_LIB}/bin"
diff --git a/bin/run-all-tests.sh b/bin/run-all-tests.sh
index 406257564..601485ec8 100755
--- a/bin/run-all-tests.sh
+++ b/bin/run-all-tests.sh
@@ -143,7 +143,7 @@ if [[ "${ERASURE_CODING}" = true ]]; then
 fi
 
 if test -v CMAKE_BUILD_TYPE && [[ "${CMAKE_BUILD_TYPE}" =~ 'UBSAN' ]] \
-    && [[ "$(uname -p)" = "aarch64" ]]; then
+    && [[ "$(uname -m)" = "aarch64" ]]; then
   # FE tests fail on ARM with
   #   libfesupport.so: cannot allocate memory in static TLS block
   # https://bugzilla.redhat.com/show_bug.cgi?id=1722181 mentions this is more likely
diff --git a/buildall.sh b/buildall.sh
index 756ad6fc8..86e2df492 100755
--- a/buildall.sh
+++ b/buildall.sh
@@ -456,7 +456,7 @@ bootstrap_dependencies() {
     echo "Toolchain bootstrap complete."
   fi
   # Use prebuilt Hadoop native binaries for aarch64
-  if [[ "$(uname -p)" = "aarch64" ]]; then
+  if [[ "$(uname -m)" = "aarch64" ]]; then
     cp $IMPALA_TOOLCHAIN_PACKAGES_HOME/hadoop-client-$IMPALA_HADOOP_CLIENT_VERSION/lib/* \
         $HADOOP_HOME/lib/native/
   fi
@@ -559,7 +559,7 @@ generate_cmake_files() {
   # If user defined CACHELINESIZE_AARCH64 in impala-config-local.sh, then we will use that
   # value, if user did not define it, then we will get the value from OS, if fail, then
   # we will use the default value 64.
-  if [[ "$(uname -p)" = "aarch64" &&  "$(uname -s)" = "Linux" ]]; then
+  if [[ "$(uname -m)" = "aarch64" &&  "$(uname -s)" = "Linux" ]]; then
     local cachelinesize=$(cat /sys/devices/system/cpu/cpu0/cache/index3/coherency_line_size)
     if [[ $cachelinesize -gt 0 ]]; then
       CACHELINESIZE_AARCH64=${CACHELINESIZE_AARCH64-$cachelinesize}
diff --git a/docker/CMakeLists.txt b/docker/CMakeLists.txt
index c5d2481ea..1f28bb3e3 100644
--- a/docker/CMakeLists.txt
+++ b/docker/CMakeLists.txt
@@ -49,18 +49,11 @@ if( "$ENV{USE_CUSTOM_IMPALA_BASE_IMAGE}" STREQUAL "true" )
   MESSAGE(STATUS "Picked custom base image: ${DISTRO_BASE_IMAGE}")
 else()
   if(${OS_DISTRIB_ID} STREQUAL "ubuntu")
-    if(${OS_DISTRIB_VERSION_ID} STREQUAL "16.04" OR
-       ${OS_DISTRIB_VERSION_ID} STREQUAL "18.04" OR
-       ${OS_DISTRIB_VERSION_ID} STREQUAL "20.04" OR
-       ${OS_DISTRIB_VERSION_ID} STREQUAL "22.04")
+    if(${OS_DISTRIB_VERSION_ID} STREQUAL "20.04" OR
+       ${OS_DISTRIB_VERSION_ID} STREQUAL "22.04" OR
+       ${OS_DISTRIB_VERSION_ID} STREQUAL "24.04")
       set(DISTRO_BASE_IMAGE "ubuntu:${OS_DISTRIB_VERSION_ID}")
       set(QUICKSTART_BASE_IMAGE "ubuntu:${OS_DISTRIB_VERSION_ID}")
-    endif()
-    if (${OS_DISTRIB_VERSION_ID} STREQUAL "16.04" OR
-        ${OS_DISTRIB_VERSION_ID} STREQUAL "18.04")
-      set(PIP "python-pip")
-    elseif (${OS_DISTRIB_VERSION_ID} STREQUAL "20.04" OR
-            ${OS_DISTRIB_VERSION_ID} STREQUAL "22.04")
       set(PIP "python3-pip")
     endif()
   elseif(${OS_DISTRIB_ID} STREQUAL "rhel" OR
@@ -69,12 +62,12 @@ else()
          ${OS_DISTRIB_ID} STREQUAL "centos")
     # The Quickstart images currently don't support using a Redhat
     # base image, so this doesn't set QUICKSTART_BASE_IMAGE.
-    if(${OS_DISTRIB_VERSION_ID} MATCHES "7.*")
-      set(DISTRO_BASE_IMAGE "$ENV{IMPALA_REDHAT7_DOCKER_BASE}")
-    elseif(${OS_DISTRIB_VERSION_ID} MATCHES "8.*")
+    if(${OS_DISTRIB_VERSION_ID} MATCHES "8.*")
       set(DISTRO_BASE_IMAGE "$ENV{IMPALA_REDHAT8_DOCKER_BASE}")
     elseif(${OS_DISTRIB_VERSION_ID} MATCHES "9.*")
       set(DISTRO_BASE_IMAGE "$ENV{IMPALA_REDHAT9_DOCKER_BASE}")
+    elseif(${OS_DISTRIB_VERSION_ID} MATCHES "10.*")
+      set(DISTRO_BASE_IMAGE "$ENV{IMPALA_REDHAT10_DOCKER_BASE}")
     endif()
   endif()
   MESSAGE(STATUS "Picked docker base image based on host OS: ${DISTRO_BASE_IMAGE}")
diff --git a/tests/custom_cluster/test_otel_trace.py b/tests/custom_cluster/test_otel_trace.py
index 4c346cb0b..780bb334b 100644
--- a/tests/custom_cluster/test_otel_trace.py
+++ b/tests/custom_cluster/test_otel_trace.py
@@ -468,13 +468,13 @@ class TestOtelTraceSelectsDMLs(TestOtelTraceBase):
     # Assert the trace exporter debug log lines were emitted.
     self.assert_impalad_log_contains("INFO", r"otel-log-handler.cc:\d+\] \[OTLP TRACE "
         r"FILE Exporter\] Export \d+ trace span\(s\) success file=\".*?"
-        r"\/opentelemetry-cpp-\d+.\d+.\d+\/exporters\/otlp\/src\/otlp_file_exporter.cc\" "
-        r"line=\"\d+\"", -1)
+        r"\/opentelemetry-cpp-\d+.\d+.\d+.*\/exporters\/otlp\/src\/"
+        r"otlp_file_exporter.cc\" line=\"\d+\"", -1)
 
     self.assert_impalad_log_contains("INFO", r"otel-log-handler.cc:\d+\] \[OTLP FILE "
         r"Client\] Write body\(Json\).*? file=\".*?"
-        r"\/opentelemetry-cpp-\d+.\d+.\d+\/exporters\/otlp\/src\/otlp_file_client.cc\" "
-        r"line=\"\d+\"", -1)
+        r"\/opentelemetry-cpp-\d+.\d+.\d+.*\/exporters\/otlp\/src\/"
+        r"otlp_file_client.cc\" line=\"\d+\"", -1)
 
   def test_hs2_getcolums(self):
     """Asserts HS2 metadata operations do not cause crashes."""
diff --git a/tests/util/otel_trace.py b/tests/util/otel_trace.py
index 3941b37d4..823b7b933 100644
--- a/tests/util/otel_trace.py
+++ b/tests/util/otel_trace.py
@@ -221,12 +221,15 @@ def __parse_line(line):
 
   try:
     resource_spans = obj["resourceSpans"]
+    # Strip off any -pX patch level from the version
+    opentelemetry_base_version = \
+      os.environ.get("IMPALA_OPENTELEMETRY_CPP_VERSION").split("-")[0]
 
     # Expected resource span attribute keys/values.
     expected_resource_attrs = {
         "service.name": "Impala",
         "service.version": IMPALA_LOCAL_BUILD_VERSION,
-        "telemetry.sdk.version": os.environ.get("IMPALA_OPENTELEMETRY_CPP_VERSION"),
+        "telemetry.sdk.version": opentelemetry_base_version,
         "telemetry.sdk.name": "opentelemetry",
         "telemetry.sdk.language": "cpp"}
 


(impala) 01/03: IMPALA-15058: Fix incorrect server_name startup flag in Python scripts

Posted by jo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

asf-gitbox-commits pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git

commit e1391bcf8869ee5f649bc30bd9988e24ba88e21d
Author: Shaunak5ach <sh...@cloudera.com>
AuthorDate: Mon Jun 15 21:09:30 2026 +0530

    IMPALA-15058: Fix incorrect server_name startup flag in Python scripts
    
    This patch updates the cluster orchestration layer and test configurations
    to use the correct server_name startup flags. It ensures the parameters
    properly align with the updated execution parameters.
    
    Change-Id: I5e47ab7e82b2eb76c839380bf1e3c2090a732e87
    Assisted-by: Gemini <https://gemini.google.com>
    Reviewed-on: http://gerrit.cloudera.org:8080/24466
    Reviewed-by: Impala Public Jenkins <im...@cloudera.com>
    Tested-by: Impala Public Jenkins <im...@cloudera.com>
---
 bin/start-impala-cluster.py                  |  4 ++--
 tests/authorization/test_authorization.py    | 24 ++++++++++++------------
 tests/authorization/test_authorized_proxy.py |  4 ++--
 tests/authorization/test_provider.py         |  4 ++--
 tests/authorization/test_ranger.py           |  8 ++++----
 tests/custom_cluster/test_kill_query.py      |  4 ++--
 6 files changed, 24 insertions(+), 24 deletions(-)

diff --git a/bin/start-impala-cluster.py b/bin/start-impala-cluster.py
index d9576f932..067098ef2 100755
--- a/bin/start-impala-cluster.py
+++ b/bin/start-impala-cluster.py
@@ -509,7 +509,7 @@ def build_catalogd_arg_list(num_catalogd, remap_ports):
       args.extend(
           ["-state_store_2_port={0}".format(state_store_port + 1)])
     if options.enable_ranger_authz:
-      args.extend(["--server-name=server1", "--ranger_service_type=hive",
+      args.extend(["--server_name=server1", "--ranger_service_type=hive",
                    "--ranger_app_id=impala", "--authorization_provider=ranger"])
     if options.enable_tls:
       args.extend(["--hostname=localhost",
@@ -761,7 +761,7 @@ def build_impalad_arg_lists(cluster_size, num_coordinators, use_exclusive_coordi
       os.environ["USE_CALCITE_PLANNER"] = "true"
 
     if options.enable_ranger_authz:
-      args = ("--server-name=server1 --ranger_service_type=hive --ranger_app_id=impala "
+      args = ("--server_name=server1 --ranger_service_type=hive --ranger_app_id=impala "
               "--authorization_provider=ranger {args}").format(args=args)
 
     if options.enable_tls:
diff --git a/tests/authorization/test_authorization.py b/tests/authorization/test_authorization.py
index 3c8ce1e00..26d147029 100644
--- a/tests/authorization/test_authorization.py
+++ b/tests/authorization/test_authorization.py
@@ -49,10 +49,10 @@ class TestAuthorization(CustomClusterTestSuite):
 
   @pytest.mark.execute_serially
   @CustomClusterTestSuite.with_args(
-    impalad_args="--server-name=server1 --ranger_service_type=hive "
+    impalad_args="--server_name=server1 --ranger_service_type=hive "
                  "--ranger_app_id=impala --authorization_provider=ranger "
                  "--min_privilege_set_for_show_stmts=select",
-    catalogd_args="--server-name=server1 --ranger_service_type=hive "
+    catalogd_args="--server_name=server1 --ranger_service_type=hive "
                   "--ranger_app_id=impala --authorization_provider=ranger")
   def test_ranger_show_iceberg_metadata_tables(self, unique_name):
     unique_db = unique_name + "_db"
@@ -139,49 +139,49 @@ class TestAuthorization(CustomClusterTestSuite):
 
   @pytest.mark.execute_serially
   @CustomClusterTestSuite.with_args(
-    impalad_args="--server-name=server1 --ranger_service_type=hive "
+    impalad_args="--server_name=server1 --ranger_service_type=hive "
                  "--ranger_app_id=impala --authorization_provider=ranger "
                  "--min_privilege_set_for_show_stmts=select",
-    catalogd_args="--server-name=server1 --ranger_service_type=hive "
+    catalogd_args="--server_name=server1 --ranger_service_type=hive "
                   "--ranger_app_id=impala --authorization_provider=ranger")
   def test_ranger_show_stmts_with_select(self, unique_name):
     self._test_ranger_show_stmts_helper(unique_name, ['select'])
 
   @pytest.mark.execute_serially
   @CustomClusterTestSuite.with_args(
-    impalad_args="--server-name=server1 --ranger_service_type=hive "
+    impalad_args="--server_name=server1 --ranger_service_type=hive "
                  "--ranger_app_id=impala --authorization_provider=ranger "
                  "--min_privilege_set_for_show_stmts=select,insert",
-    catalogd_args="--server-name=server1 --ranger_service_type=hive "
+    catalogd_args="--server_name=server1 --ranger_service_type=hive "
                   "--ranger_app_id=impala --authorization_provider=ranger")
   def test_ranger_show_stmts_with_select_insert(self, unique_name):
     self._test_ranger_show_stmts_helper(unique_name, ['select', 'insert'])
 
   @pytest.mark.execute_serially
   @CustomClusterTestSuite.with_args(
-    impalad_args="--server-name=server1 --ranger_service_type=hive "
+    impalad_args="--server_name=server1 --ranger_service_type=hive "
                  "--ranger_app_id=impala --authorization_provider=ranger "
                  "--min_privilege_set_for_show_stmts=any",
-    catalogd_args="--server-name=server1 --ranger_service_type=hive "
+    catalogd_args="--server_name=server1 --ranger_service_type=hive "
                   "--ranger_app_id=impala --authorization_provider=ranger")
   def test_ranger_show_stmts_with_any(self, unique_name):
     self._test_ranger_show_stmts_helper(unique_name, PRIVILEGES)
 
   @pytest.mark.execute_serially
   @CustomClusterTestSuite.with_args(
-    impalad_args="--server-name=server1 --ranger_service_type=hive "
+    impalad_args="--server_name=server1 --ranger_service_type=hive "
                  "--ranger_app_id=impala --authorization_provider=ranger "
                  "--num_check_authorization_threads=%d" % (random.randint(2, 128)),
-    catalogd_args="--server-name=server1 --ranger_service_type=hive "
+    catalogd_args="--server_name=server1 --ranger_service_type=hive "
                   "--ranger_app_id=impala --authorization_provider=ranger")
   def test_num_check_authorization_threads_with_ranger(self, unique_name):
     self._test_ranger_show_stmts_helper(unique_name, PRIVILEGES)
 
   @CustomClusterTestSuite.with_args(
-    impalad_args="--server-name=server1 --ranger_service_type=hive "
+    impalad_args="--server_name=server1 --ranger_service_type=hive "
                  "--ranger_app_id=impala --authorization_provider=ranger "
                  "--use_local_catalog=true",
-    catalogd_args="--server-name=server1 --ranger_service_type=hive "
+    catalogd_args="--server_name=server1 --ranger_service_type=hive "
                   "--ranger_app_id=impala --authorization_provider=ranger "
                   "--catalog_topic_mode=minimal")
   def test_local_catalog_show_dbs_with_transient_db(self, unique_name):
diff --git a/tests/authorization/test_authorized_proxy.py b/tests/authorization/test_authorized_proxy.py
index 22654f9b0..8b60972c4 100644
--- a/tests/authorization/test_authorized_proxy.py
+++ b/tests/authorization/test_authorized_proxy.py
@@ -31,13 +31,13 @@ from tests.hs2.hs2_test_suite import operation_id_to_query_id
 
 AUDIT_LOG_DIR = 'audit_log_dir'
 
-RANGER_IMPALAD_ARGS = ("--server-name=server1 "
+RANGER_IMPALAD_ARGS = ("--server_name=server1 "
                        "--ranger_service_type=hive "
                        "--ranger_app_id=impala "
                        "--authorization_provider=ranger "
                        "--abort_on_failed_audit_event=false "
                        "--audit_event_log_dir={" + AUDIT_LOG_DIR + "}")
-RANGER_CATALOGD_ARGS = ("--server-name=server1 "
+RANGER_CATALOGD_ARGS = ("--server_name=server1 "
                         "--ranger_service_type=hive "
                         "--ranger_app_id=impala "
                         "--authorization_provider=ranger")
diff --git a/tests/authorization/test_provider.py b/tests/authorization/test_provider.py
index a15f7ab9a..cc05c0e3d 100644
--- a/tests/authorization/test_provider.py
+++ b/tests/authorization/test_provider.py
@@ -43,12 +43,12 @@ class TestAuthorizationProvider(CustomClusterTestSuite):
       expect_cores=True,
       impala_log_dir="{" + LOG_DIR + "}",
       impalad_args="--minidump_path={" + MINIDUMP_PATH + "} "
-                   "--server-name=server1 "
+                   "--server_name=server1 "
                    "--ranger_service_type=hive "
                    "--ranger_app_id=impala "
                    "--authorization_provider=" + BAD_FLAG,
       catalogd_args="--minidump_path={" + MINIDUMP_PATH + "} "
-                    "--server-name=server1 "
+                    "--server_name=server1 "
                     "--ranger_service_type=hive "
                     "--ranger_app_id=impala "
                     "--authorization_provider=" + BAD_FLAG,
diff --git a/tests/authorization/test_ranger.py b/tests/authorization/test_ranger.py
index 521e223dd..8e9f502be 100644
--- a/tests/authorization/test_ranger.py
+++ b/tests/authorization/test_ranger.py
@@ -54,16 +54,16 @@ ERROR_REVOKE = "User doesn't have necessary permission to revoke access"
 RANGER_AUTH = ("admin", "admin")
 RANGER_HOST = "http://localhost:6080"
 REST_HEADERS = {"Content-Type": "application/json", "Accept": "application/json"}
-LEGACY_CATALOG_IMPALAD_ARGS = "--server-name=server1 --ranger_service_type=hive " \
+LEGACY_CATALOG_IMPALAD_ARGS = "--server_name=server1 --ranger_service_type=hive " \
     "--ranger_app_id=impala --authorization_provider=ranger " \
     "--use_local_catalog=false"
-LEGACY_CATALOG_CATALOGD_ARGS = "--server-name=server1 --ranger_service_type=hive " \
+LEGACY_CATALOG_CATALOGD_ARGS = "--server_name=server1 --ranger_service_type=hive " \
     "--ranger_app_id=impala --authorization_provider=ranger " \
     "--catalog_topic_mode=full"
 
-IMPALAD_ARGS = "--server-name=server1 --ranger_service_type=hive " \
+IMPALAD_ARGS = "--server_name=server1 --ranger_service_type=hive " \
     "--ranger_app_id=impala --authorization_provider=ranger --use_local_catalog=true"
-CATALOGD_ARGS = "--server-name=server1 --ranger_service_type=hive " \
+CATALOGD_ARGS = "--server_name=server1 --ranger_service_type=hive " \
     "--ranger_app_id=impala --authorization_provider=ranger --catalog_topic_mode=minimal"
 
 LOG = logging.getLogger('impala_test_suite')
diff --git a/tests/custom_cluster/test_kill_query.py b/tests/custom_cluster/test_kill_query.py
index f40adb6a9..4f99bc581 100644
--- a/tests/custom_cluster/test_kill_query.py
+++ b/tests/custom_cluster/test_kill_query.py
@@ -116,10 +116,10 @@ class TestKillQuery(CustomClusterTestSuite):
 
 @CustomClusterTestSuite.with_args(
     # Same as IMPALAD_ARGS and CATALOGD_ARGS in tests/authorization/test_ranger.py
-    impalad_args="--server-name=server1 --ranger_service_type=hive "
+    impalad_args="--server_name=server1 --ranger_service_type=hive "
                  "--ranger_app_id=impala --authorization_provider=ranger "
                  "--beeswax_port=21000",
-    catalogd_args="--server-name=server1 --ranger_service_type=hive "
+    catalogd_args="--server_name=server1 --ranger_service_type=hive "
                   "--ranger_app_id=impala --authorization_provider=ranger",
     cluster_size=1)
 class TestKillQueryAuthorization(CustomClusterTestSuite):


(impala) 02/03: IMPALA-15076: Fix JDBC scan duplication in UNION ALL and ResultSet race

Posted by jo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

asf-gitbox-commits pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git

commit cffe56518feb0a899c9cee9dd7bdb10f96106abc
Author: Arnab Karmakar <ar...@gmail.com>
AuthorDate: Sat Jun 13 12:06:35 2026 -0700

    IMPALA-15076: Fix JDBC scan duplication in UNION ALL and ResultSet race
    
    After IMPALA-14523 patch (shared JDBC cursor fetching), UNION ALL
    queries with JDBC tables produced incorrect results due to
    duplicate table scans. The scheduler assigned each JDBC scan node to a
    different executor based on node_id, causing UNPARTITIONED union
    fragments to spawn instances on multiple executors. Each instance would
    execute all scan nodes in the union, but only one had assigned ranges,
    leading to 3x result duplication in queries.
    
    The fix changes JDBC executor selection to hash fragment_idx instead of
    node_id, ensuring all JDBC scans within a union fragment are co-located
    on the same executor. This preserves the shared connection optimization
    while preventing duplicate reads.
    
    Additionally, fixed a race condition in JdbcRecordIterator where multiple
    threads could call ResultSet.next() after end-of-stream. Per JDBC spec,
    this behavior is vendor-specific for TYPE_FORWARD_ONLY result sets and
    may throw SQLException. Added an endOfStream flag guarded by fetchLock
    to prevent post-EOS next() calls.
    
    Testing:
    - Core TPC-DS JDBC tests now pass
    - All tests passed with exhaustive exploration strategy using release build
    - Added JDBC UNION ALL planner tests
    
    Change-Id: I60ed011faa2177af67ea681c2cd2967648e4a963
    Reviewed-on: http://gerrit.cloudera.org:8080/24464
    Reviewed-by: Impala Public Jenkins <im...@cloudera.com>
    Tested-by: Impala Public Jenkins <im...@cloudera.com>
---
 be/src/exec/data-source-scan-node.cc               |  16 ++--
 be/src/scheduling/scheduler-test-util.cc           |   2 +-
 be/src/scheduling/scheduler.cc                     |  98 +++++++++++++-------
 be/src/scheduling/scheduler.h                      |   6 +-
 .../extdatasource/jdbc/dao/JdbcRecordIterator.java |  27 +++++-
 .../org/apache/impala/planner/PlannerTest.java     |   6 +-
 .../queries/PlannerTest/jdbc-parallel.test         | 103 +++++++++++++++++++++
 7 files changed, 212 insertions(+), 46 deletions(-)

diff --git a/be/src/exec/data-source-scan-node.cc b/be/src/exec/data-source-scan-node.cc
index 9272e5428..d8a0659b8 100644
--- a/be/src/exec/data-source-scan-node.cc
+++ b/be/src/exec/data-source-scan-node.cc
@@ -533,13 +533,15 @@ void DataSourceScanNode::Close(RuntimeState* state) {
   if (is_closed()) return;
   SCOPED_TIMER(runtime_profile_->total_time_counter());
   input_batch_.reset();
-  TCloseParams params;
-  params.__set_scan_handle(scan_handle_);
-  TCloseResult result;
-  // shared_conn_->Close() only calls executor_.Close() when the last active
-  // DataSourceScanNode in the fragment decrements the reference count to zero.
-  Status status = shared_conn_->Close(params, &result);
-  if (!status.ok()) state->LogError(status.msg());
+  if (!scan_handle_.empty()) {
+    TCloseParams params;
+    params.__set_scan_handle(scan_handle_);
+    TCloseResult result;
+    // shared_conn_->Close() only calls executor_.Close() when the last active
+    // DataSourceScanNode in the fragment decrements the reference count to zero.
+    Status status = shared_conn_->Close(params, &result);
+    if (!status.ok()) state->LogError(status.msg());
+  }
   ScanNode::Close(state);
 }
 
diff --git a/be/src/scheduling/scheduler-test-util.cc b/be/src/scheduling/scheduler-test-util.cc
index bad80c6c9..fbd98efb3 100644
--- a/be/src/scheduling/scheduler-test-util.cc
+++ b/be/src/scheduling/scheduler-test-util.cc
@@ -687,7 +687,7 @@ Status SchedulerWrapper::Compute(bool exec_at_coord, Result* result,
   Scheduler::ExecutorConfig executor_config = {no_executor_group ? empty_group :
       it->second, *membership_snapshot->local_be_desc, coords};
   std::mt19937 rng(rand());
-  return scheduler_->ComputeScanRangeAssignment(executor_config, 0, nullptr, false,
+  return scheduler_->ComputeScanRangeAssignment(executor_config, 0, 0, nullptr, false,
       *locations, plan_.referenced_datanodes(), exec_at_coord, plan_.query_options(),
       nullptr, &rng, nullptr, assignment);
 }
diff --git a/be/src/scheduling/scheduler.cc b/be/src/scheduling/scheduler.cc
index c0e01df38..e64f67f71 100644
--- a/be/src/scheduling/scheduler.cc
+++ b/be/src/scheduling/scheduler.cc
@@ -312,10 +312,11 @@ Status Scheduler::ComputeScanRangeAssignment(
       }
       DCHECK(locations != nullptr);
       RETURN_IF_ERROR(
-          ComputeScanRangeAssignment(executor_config, node_id, node_replica_preference,
-              node_random_replica, *locations, exec_request.host_list, exec_at_coord,
-              state->query_options(), total_assignment_timer, state->rng(),
-              state->summary_profile(), assignment));
+          ComputeScanRangeAssignment(executor_config, node_id, fragment.idx,
+              node_replica_preference, node_random_replica, *locations,
+              exec_request.host_list, exec_at_coord, state->query_options(),
+              total_assignment_timer, state->rng(), state->summary_profile(),
+              assignment));
       state->IncNumScanRanges(locations->size());
     }
   }
@@ -603,6 +604,15 @@ Status Scheduler::ComputeFragmentExecParams(const ExecutorConfig& executor_confi
       host = coord_desc.address();
       DCHECK(coord_desc.has_krpc_address());
       krpc_host = coord_desc.krpc_address();
+    } else if (!fragment_state->scan_range_assignment.empty() &&
+        ContainsDataSourceScanNode(fragment.plan)) {
+      // JDBC virtual scan ranges are pinned to a single executor. Schedule this
+      // fragment there so DataSourceScanNode instances receive their ranges.
+      DCHECK_EQ(fragment_state->scan_range_assignment.size(), 1)
+          << "Expected single-host JDBC scan assignment for fragment "
+          << fragment.display_name;
+      host = fragment_state->scan_range_assignment.begin()->first;
+      krpc_host = LookUpKrpcHost(executor_config, host);
     } else if (fragment_state->exchange_input_fragments.size() > 0) {
       // Interior unpartitioned fragments can be scheduled on an arbitrary executor.
       // Pick a random instance from the first input fragment.
@@ -861,6 +871,21 @@ void Scheduler::CreateCollocatedAndScanInstances(const ExecutorConfig& executor_
     max_num_instances = max(1, request_query_option.mt_dop);
   }
 
+  // JDBC fragments must run only on the executor holding their virtual scan ranges.
+  // Otherwise instances on other hosts execute every DataSourceScanNode in a collocated
+  // UnionNode without assigned ranges and produce no rows.
+  if (fragment_state->scan_range_assignment.size() == 1 &&
+      ContainsDataSourceScanNode(fragment.plan)) {
+    const NetworkAddressPB& data_source_host =
+        fragment_state->scan_range_assignment.begin()->first;
+    int max_instances = max_num_instances;
+    for (const auto& entry : instances_per_host) {
+      max_instances = max(max_instances, entry.second);
+    }
+    instances_per_host.clear();
+    instances_per_host[data_source_host] = max_instances;
+  }
+
   // Track the index of the next instance to be created for this fragment.
   int per_fragment_instance_idx = 0;
   for (const auto& entry : instances_per_host) {
@@ -1089,8 +1114,9 @@ void Scheduler::CreateCollocatedJoinBuildInstances(
 }
 
 Status Scheduler::ComputeScanRangeAssignment(const ExecutorConfig& executor_config,
-    PlanNodeId node_id, const TReplicaPreference::type* node_replica_preference,
-    bool node_random_replica, const vector<TScanRangeLocationList>& locations,
+    PlanNodeId node_id, TFragmentIdx fragment_idx,
+    const TReplicaPreference::type* node_replica_preference, bool node_random_replica,
+    const vector<TScanRangeLocationList>& locations,
     const vector<TNetworkAddress>& host_list, bool exec_at_coord,
     const TQueryOptions& query_options, RuntimeProfile::Counter* timer, std::mt19937* rng,
     RuntimeProfile* summary_profile, FragmentScanRangeAssignment* assignment) {
@@ -1132,8 +1158,9 @@ Status Scheduler::ComputeScanRangeAssignment(const ExecutorConfig& executor_conf
   vector<const TScanRangeLocationList*> remote_scan_range_locations;
 
   // For JDBC data source scans: all virtual split ranges for this scan node must land on
-  // the same executor. The executor is chosen by hashing node_id so that different JDBC
-  // scan nodes in a multi-table query are distributed across different executors.
+  // the same executor. All JDBC scan nodes within the same fragment must share that
+  // executor so that a collocated UnionNode does not run on multiple hosts, where each
+  // host would otherwise execute every DataSourceScanNode child and read the full table.
   bool jdbc_executor_selected = false;
   BackendDescriptorPB jdbc_executor;
 
@@ -1143,7 +1170,34 @@ Status Scheduler::ComputeScanRangeAssignment(const ExecutorConfig& executor_conf
     TReplicaPreference::type min_distance = TReplicaPreference::REMOTE;
 
     // Select executor for the current scan range.
-    if (exec_at_coord) {
+    if (scan_range_locations.scan_range.__isset.is_data_source_scan &&
+        scan_range_locations.scan_range.is_data_source_scan) {
+      // All JDBC virtual scan ranges go to one executor so that a single shared JDBC
+      // connection can serve all N DataSourceScanNode instances in the same fragment.
+      // Select one executor on the first JDBC range and reuse it for the rest.
+      // Check this before exec_at_coord. UNPARTITIONED fragments set exec_at_coord=true,
+      // and the exec_at_coord path always assigns to the coordinator. In a distributed
+      // cluster that would pin JDBC ranges on the coordinator while fragment instances
+      // may run on executors. When NumExecutors()==0 (e.g. NUM_NODES=1), the branch
+      // below falls back to coord_desc, same as exec_at_coord would.
+      if (!jdbc_executor_selected) {
+        jdbc_executor_selected = true;
+        if (executor_config.group.NumExecutors() > 0) {
+          vector<BackendDescriptorPB> all_execs =
+              executor_config.group.GetAllExecutorDescriptors();
+          // Hash fragment_idx so every JDBC scan node in the same fragment is pinned to
+          // the same executor. Different fragments (e.g. build/probe sides of a join) may
+          // still spread across executors.
+          size_t idx = std::hash<int>{}(fragment_idx) % all_execs.size();
+          jdbc_executor = all_execs[idx];
+        } else {
+          // No executors available (coordinator-only mode): fall back to coordinator.
+          jdbc_executor = coord_desc;
+        }
+      }
+      assignment_ctx.RecordScanRangeAssignment(
+          jdbc_executor, node_id, host_list, scan_range_locations, assignment);
+    } else if (exec_at_coord) {
       DCHECK(assignment_ctx.executor_group().LookUpExecutorIp(
           coord_desc.address().hostname(), nullptr));
       assignment_ctx.RecordScanRangeAssignment(
@@ -1170,28 +1224,6 @@ Status Scheduler::ComputeScanRangeAssignment(const ExecutorConfig& executor_conf
       }
       assignment_ctx.RecordScanRangeAssignment(
         *coordinatorPB, node_id, host_list, scan_range_locations, assignment);
-    } else if (scan_range_locations.scan_range.__isset.is_data_source_scan &&
-               scan_range_locations.scan_range.is_data_source_scan) {
-      // All JDBC virtual scan ranges go to one executor so that a single shared JDBC
-      // connection can serve all N DataSourceScanNode instances in the same fragment.
-      // Select one executor on the first JDBC range and reuse it for the rest.
-      if (!jdbc_executor_selected) {
-        jdbc_executor_selected = true;
-        if (executor_config.group.NumExecutors() > 0) {
-          vector<BackendDescriptorPB> all_execs =
-              executor_config.group.GetAllExecutorDescriptors();
-          // Hash node_id to pick a consistent executor for this scan node.
-          // Different scan nodes (e.g. two JDBC tables in the same query) will hash to
-          // different executors, spreading the JDBC connections across the cluster.
-          size_t idx = std::hash<int>{}(node_id) % all_execs.size();
-          jdbc_executor = all_execs[idx];
-        } else {
-          // No executors available (coordinator-only mode): fall back to coordinator.
-          jdbc_executor = coord_desc;
-        }
-      }
-      assignment_ctx.RecordScanRangeAssignment(
-          jdbc_executor, node_id, host_list, scan_range_locations, assignment);
     } else {
       // Collect executor candidates with smallest memory distance.
       vector<IpAddr> executor_candidates;
@@ -1315,6 +1347,10 @@ bool Scheduler::ContainsScanNode(const TPlan& plan) {
   return ContainsNode(plan, SCAN_NODE_TYPES);
 }
 
+bool Scheduler::ContainsDataSourceScanNode(const TPlan& plan) {
+  return ContainsNode(plan, TPlanNodeType::DATA_SOURCE_NODE);
+}
+
 bool Scheduler::ContainsUnionNode(const TPlan& plan) {
   return ContainsNode(plan, TPlanNodeType::UNION_NODE);
 }
diff --git a/be/src/scheduling/scheduler.h b/be/src/scheduling/scheduler.h
index d50142ac0..9cb412573 100644
--- a/be/src/scheduling/scheduler.h
+++ b/be/src/scheduling/scheduler.h
@@ -357,7 +357,8 @@ class Scheduler {
   /// summary_profile:         Summary profile for any scheduler warnings.
   /// assignment:              Output parameter, to which new assignments will be added.
   Status ComputeScanRangeAssignment(const ExecutorConfig& executor_config,
-      PlanNodeId node_id, const TReplicaPreference::type* node_replica_preference,
+      PlanNodeId node_id, TFragmentIdx fragment_idx,
+      const TReplicaPreference::type* node_replica_preference,
       bool node_random_replica, const std::vector<TScanRangeLocationList>& locations,
       const std::vector<TNetworkAddress>& host_list, bool exec_at_coord,
       const TQueryOptions& query_options, RuntimeProfile::Counter* timer,
@@ -457,6 +458,9 @@ class Scheduler {
   /// Return true if 'plan' contains a scan node.
   static bool ContainsScanNode(const TPlan& plan);
 
+  /// Return true if 'plan' contains a data source (e.g. JDBC) scan node.
+  static bool ContainsDataSourceScanNode(const TPlan& plan);
+
   /// Return true if 'plan' contains a union node.
   static bool ContainsUnionNode(const TPlan& plan);
 
diff --git a/fe/src/main/java/org/apache/impala/extdatasource/jdbc/dao/JdbcRecordIterator.java b/fe/src/main/java/org/apache/impala/extdatasource/jdbc/dao/JdbcRecordIterator.java
index af5d842be..dce5cd1cb 100644
--- a/fe/src/main/java/org/apache/impala/extdatasource/jdbc/dao/JdbcRecordIterator.java
+++ b/fe/src/main/java/org/apache/impala/extdatasource/jdbc/dao/JdbcRecordIterator.java
@@ -61,6 +61,12 @@ public class JdbcRecordIterator {
   private final Calendar utcCalendar =
       Calendar.getInstance(TimeZone.getTimeZone(ZoneOffset.UTC));
 
+  /**
+   * Tracks whether the ResultSet has been fully consumed. Guarded by fetchLock.
+   * This flag ensures we never call next() after reaching end-of-stream.
+   */
+  private boolean endOfStream = false;
+
   public JdbcRecordIterator(Connection conn, PreparedStatement ps, ResultSet rs,
       Configuration conf) throws JdbcDatabaseAccessException {
     this.conn = conn;
@@ -244,8 +250,21 @@ public class JdbcRecordIterator {
       synchronized (fetchLock) {
         final long lockAcquired = System.nanoTime();
         List<Object[]> rows = new ArrayList<>(batchSize);
+
+        // Fast-path: If a previous thread exhausted the ResultSet, return empty batch
+        // immediately. This prevents calling rs.next() after EOS, which is vendor
+        // specific behavior for TYPE_FORWARD_ONLY ResultSets (may throw SQLException).
+        if (endOfStream) {
+          final long fetchDoneNs = System.nanoTime();
+          LOGGER.debug("[{}] fetchBatch: already at EOS, returning empty batch", tname);
+          return new FetchResult(rows, fetchDoneNs - lockAcquired, 0);
+        }
+
         while (rows.size() < batchSize) {
-          if (!rs.next()) break;
+          if (!rs.next()) {
+            endOfStream = true;
+            break;
+          }
           Object[] row = new Object[scalarTypes.length];
           for (int i = 0; i < scalarTypes.length; i++) {
             row[i] = readColumnValue(scalarTypes[i], i);
@@ -255,11 +274,13 @@ public class JdbcRecordIterator {
         final long fetchDoneNs = System.nanoTime();
         final long lockWaitNs = lockAcquired - lockWaitStart;
         final long cursorFetchNs = fetchDoneNs - lockAcquired;
-        LOGGER.debug("[{}] fetchBatch: waited_for_lock={}ms jdbc_fetch={}ms rows={}",
+        LOGGER.debug("[{}] fetchBatch: waited_for_lock={}ms jdbc_fetch={}ms " +
+            "rows={} eos={}",
             tname,
             lockWaitNs / 1_000_000,
             cursorFetchNs / 1_000_000,
-            rows.size());
+            rows.size(),
+            endOfStream);
         return new FetchResult(rows, lockWaitNs, cursorFetchNs);
       }
     } catch (Exception e) {
diff --git a/fe/src/test/java/org/apache/impala/planner/PlannerTest.java b/fe/src/test/java/org/apache/impala/planner/PlannerTest.java
index 7eb4f0e97..d13ea9da1 100644
--- a/fe/src/test/java/org/apache/impala/planner/PlannerTest.java
+++ b/fe/src/test/java/org/apache/impala/planner/PlannerTest.java
@@ -253,9 +253,9 @@ public class PlannerTest extends PlannerTestBase {
   }
 
   @Test
-    public void testJdbcParallel() {
-      runPlannerTestFile("jdbc-parallel");
-    }
+  public void testJdbcParallel() {
+    runPlannerTestFile("jdbc-parallel");
+  }
 
   /**
    * Test of HBase in the case of disabling the key scan.
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/jdbc-parallel.test b/testdata/workloads/functional-planner/queries/PlannerTest/jdbc-parallel.test
index 61442fc6a..f1550f5f5 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/jdbc-parallel.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/jdbc-parallel.test
@@ -3797,3 +3797,106 @@ PLAN-ROOT SINK
 01:SCAN DATA SOURCE [tpch_jdbc.orders o]
    data source predicates: o.o_orderdate >= '1995-01-01'
    row-size=24B cardinality=1.50M
+====
+// JDBC UNION ALL: all DataSourceScanNode children must be collocated in one
+// UNPARTITIONED fragment (no exchange between union operands).
+select c_custkey from tpch_jdbc.customer
+union all
+select o_custkey from tpch_jdbc.orders
+---- PLAN
+PLAN-ROOT SINK
+|
+00:UNION
+|  pass-through-operands: all
+|  row-size=8B cardinality=1.65M
+|
+|--02:SCAN DATA SOURCE [tpch_jdbc.orders]
+|     row-size=8B cardinality=1.50M
+|
+01:SCAN DATA SOURCE [tpch_jdbc.customer]
+   row-size=8B cardinality=150.00K
+---- DISTRIBUTEDPLAN
+PLAN-ROOT SINK
+|
+03:EXCHANGE [UNPARTITIONED]
+|
+00:UNION
+|  pass-through-operands: all
+|  row-size=8B cardinality=1.65M
+|
+|--02:SCAN DATA SOURCE [tpch_jdbc.orders]
+|     row-size=8B cardinality=1.50M
+|
+01:SCAN DATA SOURCE [tpch_jdbc.customer]
+   row-size=8B cardinality=150.00K
+====
+select c_custkey from tpch_jdbc.customer
+union all
+select o_custkey from tpch_jdbc.orders
+union all
+select l_orderkey from tpch_jdbc.lineitem
+---- PLAN
+PLAN-ROOT SINK
+|
+00:UNION
+|  pass-through-operands: all
+|  row-size=8B cardinality=7.65M
+|
+|--03:SCAN DATA SOURCE [tpch_jdbc.lineitem]
+|     row-size=8B cardinality=6.00M
+|
+|--02:SCAN DATA SOURCE [tpch_jdbc.orders]
+|     row-size=8B cardinality=1.50M
+|
+01:SCAN DATA SOURCE [tpch_jdbc.customer]
+   row-size=8B cardinality=150.00K
+---- DISTRIBUTEDPLAN
+PLAN-ROOT SINK
+|
+04:EXCHANGE [UNPARTITIONED]
+|
+00:UNION
+|  pass-through-operands: all
+|  row-size=8B cardinality=7.65M
+|
+|--03:SCAN DATA SOURCE [tpch_jdbc.lineitem]
+|     row-size=8B cardinality=6.00M
+|
+|--02:SCAN DATA SOURCE [tpch_jdbc.orders]
+|     row-size=8B cardinality=1.50M
+|
+01:SCAN DATA SOURCE [tpch_jdbc.customer]
+   row-size=8B cardinality=150.00K
+====
+select c_custkey from tpch_jdbc.customer
+union all
+select o_custkey from tpch_jdbc.orders
+---- QUERYOPTIONS
+MT_DOP=4
+---- PLAN
+PLAN-ROOT SINK
+|
+00:UNION
+|  pass-through-operands: all
+|  row-size=8B cardinality=1.65M
+|
+|--02:SCAN DATA SOURCE [tpch_jdbc.orders]
+|     row-size=8B cardinality=1.50M
+|
+01:SCAN DATA SOURCE [tpch_jdbc.customer]
+   row-size=8B cardinality=150.00K
+---- DISTRIBUTEDPLAN
+PLAN-ROOT SINK
+|
+03:EXCHANGE [UNPARTITIONED]
+|
+00:UNION
+|  pass-through-operands: all
+|  row-size=8B cardinality=1.65M
+|
+|--02:SCAN DATA SOURCE [tpch_jdbc.orders]
+|     row-size=8B cardinality=1.50M
+|
+01:SCAN DATA SOURCE [tpch_jdbc.customer]
+   row-size=8B cardinality=150.00K
+====