public static TxnType getTxnType(Configuration conf, ASTNode tree) {
    // check if read-only txn
    if (HiveConf.getBoolVar(conf, ConfVars.HIVE_TXN_READONLY_ENABLED) && isReadOnlyTxn(tree)) {
      return TxnType.READ_ONLY;
    }
    // check if txn has a materialized view rebuild
    if (tree.getToken().getType() == HiveParser.TOK_ALTER_MATERIALIZED_VIEW_REBUILD) {
      return TxnType.MATER_VIEW_REBUILD;
    }
    // check if soft delete txn
    if (isSoftDeleteTxn(conf, tree))  {
      return TxnType.SOFT_DELETE;
    }
    return TxnType.DEFAULT;
  }
Determines transaction type based on query AST.
@param tree AST
ql/src/java/org/apache/hadoop/hive/ql/io/AcidUtils.java