You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2020/02/17 09:28:48 UTC

[GitHub] [hive] miklosgergely commented on a change in pull request #902: HIVE-22866 schq testcases

miklosgergely commented on a change in pull request #902: HIVE-22866 schq testcases
URL: https://github.com/apache/hive/pull/902#discussion_r380030665
 
 

 ##########
 File path: ql/src/test/queries/clientpositive/schq_ingest.q
 ##########
 @@ -0,0 +1,44 @@
+--! qt:authorizer
+--! qt:scheduledqueryservice
+--! qt:sysdb
+
+set user.name=hive_admin_user;
+set role admin;
+
+drop table if exists t;
+drop table if exists s;
+ 
+-- suppose that this table is an external table or something
+-- which supports the pushdown of filter condition on the id column
+create table s(id integer, cnt integer);
+ 
+-- create an internal table and an offset table
+create table t(id integer, cnt integer);
+create table t_offset(offset integer);
+insert into t_offset values(0);
+ 
+-- pretend that data is added to s
+insert into s values(1,1);
+ 
+-- run an ingestion...
+from (select id==offset as first,* from s
+join t_offset on id>=offset) s1
+insert into t select id,cnt where first = false
+insert overwrite table t_offset select max(s1.id);
+ 
+-- configure to run ingestion every 10 minutes
+create scheduled query ingest every 10 minutes defined as
+from (select id==offset as first,* from s
+join t_offset on id>=offset) s1
+insert into t select id,cnt where first = false
+insert overwrite table t_offset select max(s1.id);
+ 
+-- add some new values
+insert into s values(2,2),(3,3);
+ 
+-- pretend that a timeout have happened
+alter scheduled query ingest execute;
+
+!sleep 3;
 
 Review comment:
   check if table t contains the appropritate data

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org