Search in sources :

Example 1 with AlterWMTriggerDesc

use of org.apache.hadoop.hive.ql.plan.AlterWMTriggerDesc in project hive by apache.

the class DDLSemanticAnalyzer method analyzeAlterTrigger.

private void analyzeAlterTrigger(ASTNode ast) throws SemanticException {
    if (ast.getChildCount() != 4) {
        throw new SemanticException("Invalid syntax for alter 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);
    AlterWMTriggerDesc desc = new AlterWMTriggerDesc(trigger);
    addServiceOutput();
    rootTasks.add(TaskFactory.get(new DDLWork(getInputs(), getOutputs(), desc)));
}
Also used : DDLWork(org.apache.hadoop.hive.ql.plan.DDLWork) WMTrigger(org.apache.hadoop.hive.metastore.api.WMTrigger) AlterWMTriggerDesc(org.apache.hadoop.hive.ql.plan.AlterWMTriggerDesc)

Aggregations

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