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 2018/01/05 21:01:00 UTC

[jira] [Commented] (TRAFODION-2868) bug of hbase option TTL

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

Suresh Subbiah commented on TRAFODION-2868:
-------------------------------------------

This is a documentation error. HBase has changed the constant denoting FOREVER from -1 to Integer.MAX_VALUE. Please see https://hbase.apache.org/apidocs/src-html/org/apache/hadoop/hbase/HConstants.html#line.621 (excerpt below)

 /**
   * Unlimited time-to-live.
   */
//  public static final int FOREVER = -1;
    public static final int FOREVER = Integer.MAX_VALUE;

If MAX_VALUE is provided as the value for TTL, vanilla HBase changes it to FOREVER. For example, from HBase shell

hbase(main):016:0> create 'jira2868', {NAME => 'f1', TTL => 2147483647}
0 row(s) in 0.1750 seconds

=> Hbase::Table - jira2868
hbase(main):017:0> describe 'jira2868'
Table jira2868 is ENABLED                                                       
jira2868                                                                        
COLUMN FAMILIES DESCRIPTION                                                     
{NAME => 'f1', DATA_BLOCK_ENCODING => 'NONE', BLOOMFILTER => 'ROW', REPLICATION_
SCOPE => '0', VERSIONS => '1', COMPRESSION => 'NONE', MIN_VERSIONS => '0', TTL =
> 'FOREVER', KEEP_DELETED_CELLS => 'FALSE', BLOCKSIZE => '65536', IN_MEMORY => '
false', BLOCKCACHE => 'true'}  

It is not clear what the meaning is when TTL is -1 or negative in general. Trafodion does not accept negative values for TTL though HBase accepts it.

Ref Manual has been changed to reflect this.

> bug of hbase option TTL 
> ------------------------
>
>                 Key: TRAFODION-2868
>                 URL: https://issues.apache.org/jira/browse/TRAFODION-2868
>             Project: Apache Trafodion
>          Issue Type: Bug
>          Components: sql-cmp
>    Affects Versions: any
>            Reporter: liyingshuai
>            Assignee: Suresh Subbiah
>
> create a table with TTL option, then an error occurred:
> CREATE TABLE t_hbaseoption22(c1 INT NOT NULL, c2 varchar(5)) SALT USING 2 PARTITIONS ON (c1) store BY (c1) HBASE_OPTIONS (TTL='-1');
> *** ERROR[8448] Unable to access Hbase interface. Call to CmpSeabaseDDL::generateHbaseOptionsArray() returned error HBASE_CREATE_OPTIONS_ERROR(710). Cause: TTL. [2017-12-25 17:45:01]
>     
>     as described in SQL REFERENCE MANUAL that the accepted value of TTL can be '-1' (forever) and  'positive-integer'
>  
>     i found the following source code, if the value is -1 then throw an error and TTL in hbase source code -1 means forever:
>  
>     CmpSeabaseDDLcommon.cpp
>     // 代码中设置不能等于-1
>     else if ((hbaseOption->key() == "TIME_TO_LIVE") || (hbaseOption->key() == "TTL"))
>        {
>             if ((str_atoi(hbaseOption->val().data(), hbaseOption->val().length()) == -1) || (!hbaseCreateOptionsArray[HBASE_TTL].empty()))
>                 isError = TRUE;
>             hbaseCreateOptionsArray[HBASE_TTL] = hbaseOption->val();



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)