@Override
  public void setQueryType(ASTNode tree) {
    queryProperties.setQueryType(QueryProperties.QueryType.DDL);
  }
Makes the exportTask run after all other tasks of the "insert into T ..." are done.
ql/src/java/org/apache/hadoop/hive/ql/parse/AcidExportSemanticAnalyzer.java