You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by "Eugene Koifman (JIRA)" <ji...@apache.org> on 2016/10/03 21:59:20 UTC

[jira] [Created] (HIVE-14883) Checks for Acid operation/bucket table write are in the wrong place

Eugene Koifman created HIVE-14883:
-------------------------------------

             Summary: Checks for Acid operation/bucket table write are in the wrong place
                 Key: HIVE-14883
                 URL: https://issues.apache.org/jira/browse/HIVE-14883
             Project: Hive
          Issue Type: Bug
          Components: Query Planning, Transactions
    Affects Versions: 1.2.0
            Reporter: Eugene Koifman
            Assignee: Eugene Koifman
             Fix For: 2.2.0


The following code in 
 in SemanticAnalyzer.getMetaData(QB qb, ReadEntity parentInput) 

{noformat}
      // Disallow INSERT INTO on bucketized tables
      boolean isAcid = AcidUtils.isAcidTable(tab);
      boolean isTableWrittenTo = qb.getParseInfo().isInsertIntoTable(tab.getDbName(), tab.getTableName());
      if (isTableWrittenTo &&
          tab.getNumBuckets() > 0 && !isAcid) {
        throw new SemanticException(ErrorMsg.INSERT_INTO_BUCKETIZED_TABLE.
            getMsg("Table: " + tabName));
      }
      // Disallow update and delete on non-acid tables
      if ((updating() || deleting()) && !isAcid && isTableWrittenTo) {
        //isTableWrittenTo: delete from acidTbl where a in (select id from nonAcidTable)
        //so only assert this if we are actually writing to this table
        // Whether we are using an acid compliant transaction manager has already been caught in
        // UpdateDeleteSemanticAnalyzer, so if we are updating or deleting and getting nonAcid
        // here, it means the table itself doesn't support it.
        throw new SemanticException(ErrorMsg.ACID_OP_ON_NONACID_TABLE, tabName);
      }
{noformat}

is done in the loop "    for (String alias : tabAliases) {" which is over tables being read.
Should be done in "    for (String name : qbp.getClauseNamesForDest()) {" loop




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)