blob: d8896ca1d336afd7450a80c41854bf91d1659493 [file] [log] [blame]
====
---- QUERY
# Create external JDBC DataSource table with username, key and keystore
DROP TABLE IF EXISTS alltypes_jdbc_datasource_keystore;
CREATE EXTERNAL TABLE alltypes_jdbc_datasource_keystore (
id INT,
bool_col BOOLEAN,
tinyint_col TINYINT,
smallint_col SMALLINT,
int_col INT,
bigint_col BIGINT,
float_col FLOAT,
double_col DOUBLE,
date_string_col STRING,
string_col STRING,
timestamp_col TIMESTAMP)
STORED BY JDBC
TBLPROPERTIES (
"database.type"="POSTGRES",
"jdbc.url"="jdbc:postgresql://$INTERNAL_LISTEN_HOST:5432/functional",
"jdbc.driver"="org.postgresql.Driver",
"driver.url"="$FILESYSTEM_PREFIX/test-warehouse/data-sources/jdbc-drivers/postgresql-jdbc.jar",
"dbcp.username"="hiveuser",
"dbcp.password.keystore"="jceks://$FILESYSTEM_URI_SCHEME/test-warehouse/data-sources/test.jceks",
"dbcp.password.key"="hiveuser",
"table"="alltypes");
---- RESULTS
'Table has been created.'
====
---- QUERY
# Test the jdbc DataSource
# count(*) with a predicate evaluated by Impala
select count(*) from alltypes_jdbc_datasource_keystore
where float_col = 0 and string_col is not NULL
---- RESULTS
730
---- TYPES
BIGINT
====
---- QUERY
# count(*) with no predicates has no materialized slots
select count(*) from alltypes_jdbc_datasource_keystore
---- RESULTS
7300
---- TYPES
BIGINT
====
---- QUERY
# Drop table
DROP TABLE alltypes_jdbc_datasource_keystore;
---- RESULTS
'Table has been dropped.'
====
---- QUERY
# Create external JDBC DataSource table with username and keystore
DROP TABLE IF EXISTS alltypes_jdbc_datasource_keystore;
CREATE EXTERNAL TABLE alltypes_jdbc_datasource_keystore (
id INT,
bool_col BOOLEAN,
tinyint_col TINYINT,
smallint_col SMALLINT,
int_col INT,
bigint_col BIGINT,
float_col FLOAT,
double_col DOUBLE,
date_string_col STRING,
string_col STRING,
timestamp_col TIMESTAMP)
STORED BY JDBC
TBLPROPERTIES (
"database.type"="POSTGRES",
"jdbc.url"="jdbc:postgresql://$INTERNAL_LISTEN_HOST:5432/functional",
"jdbc.driver"="org.postgresql.Driver",
"driver.url"="$FILESYSTEM_PREFIX/test-warehouse/data-sources/jdbc-drivers/postgresql-jdbc.jar",
"dbcp.username"="hiveuser",
"dbcp.password.keystore"="jceks://$FILESYSTEM_URI_SCHEME/test-warehouse/data-sources/test.jceks",
"table"="alltypes");
---- RESULTS
'Table has been created.'
====
---- QUERY
# Test the jdbc DataSource
# count(*) with a predicate evaluated by Impala
select count(*) from alltypes_jdbc_datasource_keystore
where float_col = 0 and string_col is not NULL
---- RESULTS
730
---- TYPES
BIGINT
====
---- QUERY
# count(*) with no predicates has no materialized slots
select count(*) from alltypes_jdbc_datasource_keystore
---- RESULTS
7300
---- TYPES
BIGINT
====
---- QUERY
# Drop table
DROP TABLE alltypes_jdbc_datasource_keystore;
---- RESULTS
'Table has been dropped.'
====