kasakrisz commented on a change in pull request #2685:
URL: https://github.com/apache/hive/pull/2685#discussion_r727987446
##########
File path: ql/src/test/queries/clientpositive/external_jdbc_join_mv.q
##########
@@ -0,0 +1,60 @@
+set hive.support.concurrency=true;
+set hive.txn.manager=org.apache.hadoop.hive.ql.lockmgr.DbTxnManager;
+
+CREATE TEMPORARY FUNCTION dboutput AS
'org.apache.hadoop.hive.contrib.genericudf.example.GenericUDFDBOutput';
+
+SELECT
+dboutput (
'jdbc:derby:;databaseName=${system:test.tmp.dir}/test_jdbc_join_mv;create=true','','',
+'CREATE TABLE person ("id" INTEGER, "name" VARCHAR(25), "jid" INTEGER, "cid"
INTEGER)' );
+
+SELECT
+dboutput (
'jdbc:derby:;databaseName=${system:test.tmp.dir}/test_jdbc_join_mv;create=true','','',
+'CREATE TABLE country ("id" INTEGER, "name" VARCHAR(25))' );
+
+CREATE EXTERNAL TABLE person
+(
+ id int,
+ name varchar(25),
+ jid int,
+ cid int
+)
+STORED BY 'org.apache.hive.storage.jdbc.JdbcStorageHandler'
+TBLPROPERTIES (
+ "hive.sql.database.type" = "DERBY",
+ "hive.sql.jdbc.driver" =
"org.apache.derby.jdbc.EmbeddedDriver",
+ "hive.sql.jdbc.url" =
"jdbc:derby:;databaseName=${system:test.tmp.dir}/test_jdbc_join_mv;create=true;collation=TERRITORY_BASED:PRIMARY",
+ "hive.sql.dbcp.username" = "APP",
+ "hive.sql.dbcp.password" = "mine",
+ "hive.sql.table" = "PERSON",
+ "hive.sql.dbcp.maxActive" = "1"
+);
+
+CREATE EXTERNAL TABLE country
+(
+ id int,
+ name varchar(25)
+)
+ STORED BY 'org.apache.hive.storage.jdbc.JdbcStorageHandler'
+ TBLPROPERTIES (
+ "hive.sql.database.type" = "DERBY",
+ "hive.sql.jdbc.driver" = "org.apache.derby.jdbc.EmbeddedDriver",
+ "hive.sql.jdbc.url" =
"jdbc:derby:;databaseName=${system:test.tmp.dir}/test_jdbc_join_mv;create=true;collation=TERRITORY_BASED:PRIMARY",
+ "hive.sql.dbcp.username" = "APP",
+ "hive.sql.dbcp.password" = "mine",
+ "hive.sql.table" = "COUNTRY",
+ "hive.sql.dbcp.maxActive" = "1"
+ );
+
+CREATE TABLE job (
+ id int,
+ title varchar(20)
+) STORED AS ORC TBLPROPERTIES ('transactional'='true');
+
+CREATE MATERIALIZED VIEW mv1 AS SELECT id, title FROM job WHERE title =
'Software Engineer';
+
+explain cbo
+select *
+from person
+join job on person.jid = job.id
+join country on person.cid = country.id
+where job.title = 'Software Engineer';
Review comment:
Please drop the materialized view in the end of the test.
MVs plan are cached in memory in HS2 without any time constraint and it can
affect other test cases when running in batch.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]