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

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

commit 5f91838adaf55dd3a5818f5ad680254b292ebe1b
Author: Joe McDonnell <[email protected]>
AuthorDate: Fri Nov 7 13:16:46 2025 -0800

    IMPALA-14545: Don't use absolute hdfs paths for JDBC table driver.url
    
    After IMPALA-13661 merged, S3PlannerTest.testDataSourceTables
    has been failing with an error trying to fetch the JDBC driver
    for functional.jdbc_decimal_tbl. This particular table's
    definition uses a path like 'hdfs://localhost:20500/test-warehouse/...'
    which explicitly depends on HDFS rather than relying
    on the default filesystem. Changing this to use a path like
    '/test-warehouse/...' without the HDFS dependency fixes the
    S3PlannerTest. This changes create-ext-data-source-table.sql
    to a template using WAREHOUSE_LOCATION_PREFIX and replaces that
    variable before executing it. This is important for Ozone, as
    Ozone uses a WAREHOUSE_LOCATION_PREFIX set to the Ozone volume.
    
    Testing:
     - Ran S3 and regular HDFS fe tests
    
    Change-Id: I3f2c86fcc6c1dee75d7d9a9be04468cb197ae13c
    Reviewed-on: http://gerrit.cloudera.org:8080/23658
    Reviewed-by: Wenzhe Zhou <[email protected]>
    Reviewed-by: Michael Smith <[email protected]>
    Tested-by: Impala Public Jenkins <[email protected]>
---
 ...table.sql => create-ext-data-source-table.sql.template} | 14 +++++++-------
 testdata/bin/create-load-data.sh                           |  7 ++++++-
 2 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/testdata/bin/create-ext-data-source-table.sql 
b/testdata/bin/create-ext-data-source-table.sql.template
similarity index 86%
rename from testdata/bin/create-ext-data-source-table.sql
rename to testdata/bin/create-ext-data-source-table.sql.template
index 869191548..7bda057b3 100644
--- a/testdata/bin/create-ext-data-source-table.sql
+++ b/testdata/bin/create-ext-data-source-table.sql.template
@@ -22,7 +22,7 @@ USE functional;
 
 DROP DATA SOURCE IF EXISTS AllTypesDataSource;
 CREATE DATA SOURCE AllTypesDataSource
-LOCATION '/test-warehouse/data-sources/test-data-source.jar'
+LOCATION 
'$WAREHOUSE_LOCATION_PREFIX/test-warehouse/data-sources/test-data-source.jar'
 CLASS 'org.apache.impala.extdatasource.AllTypesDataSource'
 API_VERSION 'V1';
 
@@ -64,7 +64,7 @@ TBLPROPERTIES (
 "database.type"="POSTGRES",
 "jdbc.url"="jdbc:postgresql://localhost:5432/functional",
 "jdbc.driver"="org.postgresql.Driver",
-"driver.url"="/test-warehouse/data-sources/jdbc-drivers/postgresql-jdbc.jar",
+"driver.url"="$WAREHOUSE_LOCATION_PREFIX/test-warehouse/data-sources/jdbc-drivers/postgresql-jdbc.jar",
 "dbcp.username"="hiveuser",
 "dbcp.password"="password",
 "table"="alltypes");
@@ -87,7 +87,7 @@ TBLPROPERTIES (
 "database.type"="POSTGRES",
 "jdbc.url"="jdbc:postgresql://localhost:5432/functional",
 "jdbc.driver"="org.postgresql.Driver",
-"driver.url"="hdfs://localhost:20500/test-warehouse/data-sources/jdbc-drivers/postgresql-jdbc.jar",
+"driver.url"="$WAREHOUSE_LOCATION_PREFIX/test-warehouse/data-sources/jdbc-drivers/postgresql-jdbc.jar",
 "dbcp.username"="hiveuser",
 "dbcp.password"="password",
 "table"="AllTypesWithQuote",
@@ -105,7 +105,7 @@ TBLPROPERTIES (
 "database.type"="POSTGRES",
 "jdbc.url"="jdbc:postgresql://localhost:5432/functional",
 "jdbc.driver"="org.postgresql.Driver",
-"driver.url"="hdfs://localhost:20500/test-warehouse/data-sources/jdbc-drivers/postgresql-jdbc.jar",
+"driver.url"="$WAREHOUSE_LOCATION_PREFIX/test-warehouse/data-sources/jdbc-drivers/postgresql-jdbc.jar",
 "dbcp.username"="hiveuser",
 "dbcp.password"="password",
 "table"="decimal_tbl");
@@ -125,7 +125,7 @@ TBLPROPERTIES (
 "database.type"="POSTGRES",
 "jdbc.url"="jdbc:postgresql://localhost:5432/functional",
 "jdbc.driver"="org.postgresql.Driver",
-"driver.url"="/test-warehouse/data-sources/jdbc-drivers/postgresql-jdbc.jar",
+"driver.url"="$WAREHOUSE_LOCATION_PREFIX/test-warehouse/data-sources/jdbc-drivers/postgresql-jdbc.jar",
 "dbcp.username"="hiveuser",
 "dbcp.password"="password",
 "table"="test_strategy");
@@ -145,7 +145,7 @@ TBLPROPERTIES (
 "database.type"="POSTGRES",
 "jdbc.url"="jdbc:postgresql://localhost:5432/functional",
 "jdbc.driver"="org.postgresql.Driver",
-"driver.url"="/test-warehouse/data-sources/jdbc-drivers/postgresql-jdbc.jar",
+"driver.url"="$WAREHOUSE_LOCATION_PREFIX/test-warehouse/data-sources/jdbc-drivers/postgresql-jdbc.jar",
 "dbcp.username"="hiveuser",
 "dbcp.password"="password",
-"table"="test_strategy");
\ No newline at end of file
+"table"="test_strategy");
diff --git a/testdata/bin/create-load-data.sh b/testdata/bin/create-load-data.sh
index 42deb1650..83088248d 100755
--- a/testdata/bin/create-load-data.sh
+++ b/testdata/bin/create-load-data.sh
@@ -499,9 +499,14 @@ function copy-and-load-ext-data-source {
   ${IMPALA_HOME}/testdata/bin/copy-ext-data-sources.sh
   # Load the underlying data of the data source
   ${IMPALA_HOME}/testdata/bin/load-ext-data-sources.sh
+  # Fill in the create-ext-data-source-table.sql.template to replace
+  # $WAREHOUSE_LOCATION_PREFIX
+  cat ${IMPALA_HOME}/testdata/bin/create-ext-data-source-table.sql.template \
+      | sed "s#\$WAREHOUSE_LOCATION_PREFIX#${WAREHOUSE_LOCATION_PREFIX}#" \
+      > ${IMPALA_DATA_LOADING_LOGS_DIR}/create-ext-data-source-table.sql
   # Create data sources table.
   ${IMPALA_HOME}/bin/impala-shell.sh -i ${IMPALAD} -f\
-      ${IMPALA_HOME}/testdata/bin/create-ext-data-source-table.sql
+      ${IMPALA_DATA_LOADING_LOGS_DIR}/create-ext-data-source-table.sql
   # Create external JDBC tables for TPCH/TPCDS queries.
   ${IMPALA_HOME}/testdata/bin/create-tpc-jdbc-tables.py 
--jdbc_db_name=tpch_jdbc \
       --workload=tpch --database_type=impala --clean

Reply via email to