use of org.apache.hadoop.hive.ql.plan.CreateWMTriggerDesc in project hive by apache.
the class DDLSemanticAnalyzer method analyzeCreateTrigger.
private void analyzeCreateTrigger(ASTNode ast) throws SemanticException {
if (ast.getChildCount() != 4) {
throw new SemanticException("Invalid syntax for create trigger statement");
}
String rpName = unescapeIdentifier(ast.getChild(0).getText());
String triggerName = unescapeIdentifier(ast.getChild(1).getText());
String triggerExpression = buildTriggerExpression((ASTNode) ast.getChild(2));
String actionExpression = buildTriggerActionExpression((ASTNode) ast.getChild(3));
WMTrigger trigger = new WMTrigger(rpName, triggerName);
trigger.setTriggerExpression(triggerExpression);
trigger.setActionExpression(actionExpression);
CreateWMTriggerDesc desc = new CreateWMTriggerDesc(trigger);
addServiceOutput();
rootTasks.add(TaskFactory.get(new DDLWork(getInputs(), getOutputs(), desc)));
}
Aggregations