use of org.apache.hadoop.hive.ql.wm.Expression in project hive by apache.
the class TestTriggersTezSessionPoolManager method testTriggerCustomNonExistent.
@Test(timeout = 60000)
public void testTriggerCustomNonExistent() throws Exception {
Expression expression = ExpressionFactory.fromString("OPEN_FILES > 50");
Trigger trigger = new ExecutionTrigger("non_existent", expression, new Action(Action.Type.KILL_QUERY));
setupTriggers(Lists.newArrayList(trigger));
String query = "select l.under_col, l.value from " + tableName + " l join " + tableName + " r on l.under_col>=r.under_col";
runQueryWithTrigger(query, null, null);
}
use of org.apache.hadoop.hive.ql.wm.Expression in project hive by apache.
the class TestTriggersTezSessionPoolManager method testTriggerHighBytesWrite.
@Test(timeout = 60000)
public void testTriggerHighBytesWrite() throws Exception {
Expression expression = ExpressionFactory.fromString("FILE_BYTES_WRITTEN > 100");
Trigger trigger = new ExecutionTrigger("big_write", expression, new Action(Action.Type.KILL_QUERY));
setupTriggers(Lists.newArrayList(trigger));
String query = "select sleep(t1.under_col, 5), t1.value from " + tableName + " t1 join " + tableName + " t2 on t1.under_col>=t2.under_col";
runQueryWithTrigger(query, null, trigger + " violated");
}
use of org.apache.hadoop.hive.ql.wm.Expression in project hive by apache.
the class TestTriggersTezSessionPoolManager method testTriggerCustomCreatedFiles.
@Test(timeout = 120000)
public void testTriggerCustomCreatedFiles() throws Exception {
List<String> cmds = getConfigs();
Expression expression = ExpressionFactory.fromString("CREATED_FILES > 5");
Trigger trigger = new ExecutionTrigger("high_read_ops", expression, new Action(Action.Type.KILL_QUERY));
setupTriggers(Lists.newArrayList(trigger));
String query = "create table testtab2 as select * from " + tableName;
runQueryWithTrigger(query, cmds, trigger + " violated");
// partitioned insert
expression = ExpressionFactory.fromString("CREATED_FILES > 10");
trigger = new ExecutionTrigger("high_read_ops", expression, new Action(Action.Type.KILL_QUERY));
setupTriggers(Lists.newArrayList(trigger));
cmds.add("drop table src3");
cmds.add("create table src3 (key int) partitioned by (value string)");
query = "insert overwrite table src3 partition (value) select sleep(under_col, 10), value from " + tableName + " where under_col < 100";
runQueryWithTrigger(query, cmds, trigger + " violated");
}
Aggregations