private static String getTimeStampString(HiveConf conf, ASTNode node, String nodeText) throws SemanticException {
    if (node.getChildCount() > 0) {
      QueryState queryState = new QueryState.Builder().withGenerateNewQueryId(false).withHiveConf(conf).build();
      SemanticAnalyzer sem = (SemanticAnalyzer) SemanticAnalyzerFactory.get(queryState, node);
      ExprNodeDesc desc = sem.genExprNodeDesc(node, new RowResolver(), false, true);
      if(!(desc instanceof ExprNodeConstantDesc))  {
        throw new SemanticException("Invalid timestamp expression");
      }
      ExprNodeConstantDesc constantDesc = (ExprNodeConstantDesc) desc;
      return String.valueOf(constantDesc.getValue());
    }
    return nodeText;
  }
Analyzer for ALTER TABLE ... EXECUTE commands.
ql/src/java/org/apache/hadoop/hive/ql/ddl/table/execute/AlterTableExecuteAnalyzer.java