You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafodion.apache.org by "Suresh Subbiah (JIRA)" <ji...@apache.org> on 2015/10/06 22:21:27 UTC

[jira] [Commented] (TRAFODION-1279) LP Bug: 1465901 - Assertion failure during SELECT on a table where a column was dropped and re-added

    [ https://issues.apache.org/jira/browse/TRAFODION-1279?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14945695#comment-14945695 ] 

Suresh Subbiah commented on TRAFODION-1279:
-------------------------------------------

Please use the attached file to verify if problem exists. The last 2 statements should assert.

The problem is that when a column is added with alter table add column statment the column qualifier that is stored in metadata could be incorrect. Previously the the column qualifier for the newly added column is simply existing colCount + 1. This logic does not work well when columns are dropped as well as added.

Note that when a column is dropped we delete those cells/column from HBase, so the add statement does not have to consider collision with a previously dropped column.

New logic finds the maximum of column qualifier value for all columns of that table from metadata. The new column is assigned a value that is one more than previous maximum.

> LP Bug: 1465901 - Assertion failure during SELECT on a table where a column was dropped and re-added
> ----------------------------------------------------------------------------------------------------
>
>                 Key: TRAFODION-1279
>                 URL: https://issues.apache.org/jira/browse/TRAFODION-1279
>             Project: Apache Trafodion
>          Issue Type: Bug
>          Components: sql-general
>            Reporter: Atanu Mishra
>            Assignee: Suresh Subbiah
>            Priority: Critical
>             Fix For: 2.0-incubating
>
>         Attachments: addcol.txt
>
>
> The query is 
> >>SELECT a.* from T_RELATIONSHIP a, T_OBJECTTYPE b WHERE b.OBJECTCODE = 'worker.hire' AND (a.FROMOBJECTTYPEID = b.ID OR a.TOOBJECTTYPEID = b.id) ORDER BY a.OPPORTUNITYRELEVANCY DESC;
> *** ERROR[2006] Internal error: assertion failure () in file ../common/BaseTypes.cpp at line 118.
> *** ERROR[8822] The statement was not prepared.
> The column OPPORTUNITYRELEVANCY in T_RELATiONSHIP was dropped and recreated with different type
> >>showddl T_RELATIONSHIP;
> CREATE TABLE TRAFODION.E_META.T_RELATIONSHIP
>   (
>     ID                               INT UNSIGNED GENERATED BY DEFAULT AS
>       IDENTITY (  START WITH 1  INCREMENT BY 1  MAXVALUE 4294967295  MINVALUE 1
>        CACHE 25  NO CYCLE  INT UNSIGNED  ) NOT NULL NOT DROPPABLE
>   , TYPECODE                         VARCHAR(20) CHARACTER SET ISO88591 COLLATE
>       DEFAULT NO DEFAULT NOT NULL NOT DROPPABLE
>   , FROMOBJECTTYPEID                 INT UNSIGNED NO DEFAULT NOT NULL NOT
>       DROPPABLE
>   , TOOBJECTTYPEID                   INT UNSIGNED NO DEFAULT NOT NULL NOT
>       DROPPABLE
>   , OPPORTUNITYEXPIRATIONDURATION    VARCHAR(100) CHARACTER SET ISO88591
>       COLLATE DEFAULT DEFAULT NULL /* added col */
>   , OPPORTUNITYRELEVANCY             SMALLINT DEFAULT NULL /* added col */
>   , RELATEDPRIORITY                  SMALLINT DEFAULT NULL /* added col */
>   , PRIMARY KEY (ID ASC)
>   )
> ;



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