IMPALA-14005: Support for quoted reserved words column names

This change updates the way column names are
projected in the SQL query generated for JDBC
external tables. Instead of relying on optional
mapping or default behavior, all column names are now
explicitly quoted using appropriate quote characters.

Column names are now wrapped with quote characters
based on the JDBC driver being used:
1. Backticks (`) for Hive, Impala and MySQL
2. Double quotes (") for all other databases

This helps in the support for case-sensitive or
reserved column names.

Change-Id: I5da5bc7ea5df8f094b7e2877a0ebf35662f93805
Reviewed-on: http://gerrit.cloudera.org:8080/23066
Tested-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com>
Reviewed-by: Wenzhe Zhou <wzhou@cloudera.com>
This commit is contained in:
pranav.lodha
2025-06-17 15:55:47 +05:30
committed by Wenzhe Zhou
parent 6a97109551
commit acca24fe02
7 changed files with 473 additions and 6 deletions

View File

@@ -128,4 +128,24 @@ TBLPROPERTIES (
"driver.url"="/test-warehouse/data-sources/jdbc-drivers/postgresql-jdbc.jar",
"dbcp.username"="hiveuser",
"dbcp.password"="password",
"table"="test_strategy");
DROP TABLE IF EXISTS quoted_impala;
CREATE EXTERNAL TABLE IF NOT EXISTS quoted_impala (
strategy_id INT,
name STRING,
referrer STRING,
landing STRING,
priority INT,
`freeze` STRING,
last_modified timestamp,
PRIMARY KEY (strategy_id) )
STORED BY JDBC
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",
"dbcp.username"="hiveuser",
"dbcp.password"="password",
"table"="test_strategy");