Search in sources :

Example 1 with CreateWMTriggerDesc

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)));
}
Also used : CreateWMTriggerDesc(org.apache.hadoop.hive.ql.plan.CreateWMTriggerDesc) DDLWork(org.apache.hadoop.hive.ql.plan.DDLWork) WMTrigger(org.apache.hadoop.hive.metastore.api.WMTrigger)

Aggregations

WMTrigger (org.apache.hadoop.hive.metastore.api.WMTrigger)1 CreateWMTriggerDesc (org.apache.hadoop.hive.ql.plan.CreateWMTriggerDesc)1 DDLWork (org.apache.hadoop.hive.ql.plan.DDLWork)1