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

Anoop Sharma commented on TRAFODION-3084:
-----------------------------------------

comment can be added on an object which has an object uid in traf metadata 
OBJECTS table.

If an hbase table is created from hbase shell, then it needs to be registered 
in traf metadata first.

upd stats internally registers it which is why comment could be added after 
that.

To explicitly register it, do:

  register hbase table <hbase-table-name>

 

Example:

>>comment on table hbase."_CELL_".myhbt is 'test';

*** ERROR[1389] Object HBASE."_CELL_".MYHBT does not exist in Trafodion.

--- SQL operation failed with errors.
>>register hbase table hbase."_CELL_".myhbt;

--- SQL operation complete.
>>
>>comment on table hbase."_CELL_".myhbt is 'test';

--- SQL operation complete.
>>

 

Same issue will show up with native hive tables. They need to be registered in 
traf metadata before doing any traf related operation. 

>>comment on table hive.hive.myht is 'test';

*** ERROR[1389] Object HIVE.HIVE.MYHT does not exist in Trafodion.

--- SQL operation failed with errors.
>>register hive table hive.hive.myht;

--- SQL operation complete.
>>
>>comment on table hive.hive.myht is 'test';

--- SQL operation complete.
>>

 

We should also fix code to automatically register HBase/Hive tables if 
'comment' operations is done on them. That way users will not have to 
explicitly register them. This will be similar to how they are automatically 
registered on some traf operations, like upd stats, or creating an external 
table, or views, etc.

 

> Cannot create comment on HBASE table
> ------------------------------------
>
>                 Key: TRAFODION-3084
>                 URL: https://issues.apache.org/jira/browse/TRAFODION-3084
>             Project: Apache Trafodion
>          Issue Type: Bug
>            Reporter: shaoyong.li
>            Assignee: shaoyong.li
>            Priority: Major
>
> I found I cannot direct create comment on hbase table. 
>  SQL>comment on table hbase."_CELL_"."cdr" is 'test'
> ERROR[1389] Object HBASE."_CELL_"."cdr" does not exist in Trafodion. 
> [2018-05-14 15:55:40]
> But, after doing update statistics on hbase table successfully, comment 
> statement runs successfully on hbase table.
> SQL>update statistics for table hbase."_CELL_"."cdr" on every column;
> — SQL operation complete.
> SQL>comment on table hbase."_CELL_"."cdr" is 'test cdr';
> — SQL operation complete.
> SQL>showddl hbase."_CELL_"."cdr";
> /*
>  CREATE TABLE HBASE."_CELL_"."cdr"
>    (
>      ROW_ID VARCHAR(100) CHARACTER SET ISO88591
>        COLLATE DEFAULT NO DEFAULT NOT NULL NOT DROPPABLE NOT SERIALIZED
>    , COL_FAMILY VARCHAR(100) CHARACTER SET ISO88591
>        COLLATE DEFAULT NO DEFAULT NOT NULL NOT DROPPABLE NOT SERIALIZED
>    , COL_NAME VARCHAR(100) CHARACTER SET ISO88591
>        COLLATE DEFAULT NO DEFAULT NOT NULL NOT DROPPABLE NOT SERIALIZED
>    , COL_TIMESTAMP LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
>        NOT SERIALIZED
>    , COL_VALUE VARCHAR(1000) CHARACTER SET ISO88591
>        COLLATE DEFAULT NO DEFAULT NOT NULL NOT DROPPABLE NOT SERIALIZED
>    , PRIMARY KEY (ROW_ID ASC)
>    )
>  ;
>  */
> /* HBase DDL */
>  CREATE HBASE TABLE cdr ( COLUMN FAMILY '#1')
> REGISTER /*INTERNAL*/ HBASE TABLE cdr;
>  /* ObjectUID = 6735857105763057363 */
> COMMENT ON TABLE HBASE."_CELL_"."cdr" IS 'test cdr' ;
> – GRANT SELECT, INSERT, DELETE, UPDATE, REFERENCES ON HBASE."_CELL_"."cdr" TO 
> DB__HBASEROLE WITH GRANT OPTION;
> — SQL operation complete.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to