[
https://issues.apache.org/jira/browse/IMPALA-12470?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17786434#comment-17786434
]
ASF subversion and git services commented on IMPALA-12470:
----------------------------------------------------------
Commit 8fe471d4698180e1b8b726c278b8a066fe06e416 in impala's branch
refs/heads/master from gaurav1086
[ https://gitbox.apache.org/repos/asf?p=impala.git;h=8fe471d46 ]
IMPALA-12470 (PART-3): delete temporary jar file
in GenericJdbcDatabaseAccessor close() function
The earlier change had a bug where we are deleting
the temporary jdbc jar file too early from the
/tmp directory before it can be loaded. The
GenericJdbcDatabaseAccessor class loader works by
OnDemand loading. Hence move the delete file logic
to the GenericJdbcDatabaseAccessor close()
function instead.
Testing:
1. Make sure the Impala cluster has been started.
2. Copy the jar files of JDBC drivers and the data source library into
HDFS.
${IMPALA_HOME}/testdata/bin/copy-ext-data-sources.sh
Verify that the mysql-jdbc.jar is present in the hdfs path:
hadoop fs -ls /test-warehouse/data-sources/jdbc-drivers
3. Create an `alltypes` table in the mysql database.
${IMPALA_HOME}/testdata/bin/load-ext-data-sources.sh
4. Create mysql data source tables (alltypes_jdbc_datasource and
alltypes_jdbc_datasource_2).
${IMPALA_HOME}/bin/impala-shell.sh -f\
${IMPALA_HOME}/testdata/bin/create-ext-data-source-table.sql
5. Make sure that the mysql jar file is not present in the classpath
grep 'mysql' /home/gsingh/Impala/fe/target/build-classpath.txt \
/home/gsingh/Impala/fe/target/test-classpath.txt \
/home/gsingh/Impala/java/executor-deps/target/build-executor-\
deps-classpath.txt | wc -l
returns 0
6. Run the impala-shell query:
use functional;
select count(*) from alltypes_jdbc_mysql_datasource;
executes successfully and returns the row count.
Change-Id: I1becc01a9d93a99be8f47dfe99258dea3a8abeb3
Reviewed-on: http://gerrit.cloudera.org:8080/20706
Reviewed-by: Wenzhe Zhou <[email protected]>
Tested-by: Impala Public Jenkins <[email protected]>
> Support different schemes for jdbc driver url when creating external jdbc
> table
> -------------------------------------------------------------------------------
>
> Key: IMPALA-12470
> URL: https://issues.apache.org/jira/browse/IMPALA-12470
> Project: IMPALA
> Issue Type: Sub-task
> Components: Frontend
> Reporter: Wenzhe Zhou
> Assignee: gaurav singh
> Priority: Major
> Fix For: Impala 4.4.0
>
> Time Spent: 40m
> Remaining Estimate: 0h
>
> jdbc driver url is specified as table property 'driver.url' when creating a
> external jdbc table, like the sample below:
> {code:java}
> CREATE TABLE test_postgres (
> id INT,
> string_col STRING)
> PRODUCED BY DATA SOURCE JdbcDataSource(
> '{"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-driver/postgresql-jdbc.jar",
> "dbcp.username":"hiveuser",
> "dbcp.password":"password",
> "table":"alltypes"}');
> {code}
> In the initial patch, we only support to download the driver jar files from
> hdfs. We need to support different storage type, like 'file://', 's3a://',
> etc.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]