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

ASF GitHub Bot commented on TRAFODION-2977:
-------------------------------------------

GitHub user DaveBirdsall opened a pull request:

    https://github.com/apache/trafodion/pull/1473

    [TRAFODION-2977] Fix issues with maximum key length detection

    This set of changes fixes several minor bugs:
    
    1. The key length limit that Trafodion imposes differed from the HBase 
limit. They are now the same.
    
    2. CREATE INDEX logic lacked a check on key length. This has now been added.
    
    3. There was a typo in the message text for message 1141 preventing the 
computed key length from being displayed. This has been fixed.
    
    4. There was a bug in the generator where, if CREATE INDEX were allowed to 
have a long key, we generated plans to populate that index that would overrun 
their buffers, causing ESPs to core. This has been fixed; we now guarantee that 
buffers are long enough for at least one row.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/DaveBirdsall/trafodion Trafodion2977

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/trafodion/pull/1473.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1473
    
----
commit e7fd657474842b017e26f50aeda3895b7cfd337c
Author: Dave Birdsall <dbirdsall@...>
Date:   2018-03-13T20:00:18Z

    [TRAFODION-2977] Fix issues with maximum key length detection

----


> Trafodion allows creating objects with longer key lengths than HBase supports
> -----------------------------------------------------------------------------
>
>                 Key: TRAFODION-2977
>                 URL: https://issues.apache.org/jira/browse/TRAFODION-2977
>             Project: Apache Trafodion
>          Issue Type: Bug
>          Components: sql-cmp
>    Affects Versions: 2.3
>            Reporter: David Wayne Birdsall
>            Assignee: David Wayne Birdsall
>            Priority: Major
>
> The following illustrates the problem:
> {quote}
> >>create table t0 (c1 char(16777216));
> --- SQL operation complete.
> >>
> >>insert into t0 values ('A');
> --- 1 row(s) inserted.
> >>
> >>create table t1 (c1 char(32768) unique);
> --- SQL operation complete.
> >>
> >>-- next statement fails
> >>insert into t1 values ('A');
> *** ERROR[8448] Unable to access Hbase interface. Call to 
> ExpHbaseInterface::checkAndInsertRow returned error HBASE_ACCESS_ERROR(-706). 
> Cause: java.lang.IllegalArgumentException: Row length 32770 is > 32767
> org.apache.hadoop.hbase.client.Mutation.checkRow(Mutation.java:537)
> org.apache.hadoop.hbase.client.Put.<init>(Put.java:110)
> org.apache.hadoop.hbase.client.Put.<init>(Put.java:68)
> org.apache.hadoop.hbase.client.Put.<init>(Put.java:58)
> org.trafodion.sql.HTableClient.putRow(HTableClient.java:1543)
> org.trafodion.sql.HBaseClient.insertRow(HBaseClient.java:1931).
> --- 0 row(s) inserted.
> >>
> >>create table t2 (c1 char(32768) not null primary key);
> --- SQL operation complete.
> >>
> >>-- next statement fails
> >>insert into t2 values ('A');
> *** ERROR[8448] Unable to access Hbase interface. Call to 
> ExpHbaseInterface::checkAndInsertRow returned error HBASE_ACCESS_ERROR(-706). 
> Cause: java.lang.IllegalArgumentException: Row length 32768 is > 32767
> org.apache.hadoop.hbase.client.Mutation.checkRow(Mutation.java:537)
> org.apache.hadoop.hbase.client.Put.<init>(Put.java:110)
> org.apache.hadoop.hbase.client.Put.<init>(Put.java:68)
> org.apache.hadoop.hbase.client.Put.<init>(Put.java:58)
> org.trafodion.sql.HTableClient.putRow(HTableClient.java:1543)
> org.trafodion.sql.HBaseClient.insertRow(HBaseClient.java:1931).
> --- 0 row(s) inserted.
> >>
> >>create table t3 (c1 char(32768) check (c1!='ZZZZ'));
> --- SQL operation complete.
> >>
> >>insert into t3 values ('A');
> --- 1 row(s) inserted.
> >>
> {quote}
>  
> In the example above, table T1 has an implicit index with a key length 
> greater than 32767. Table T2 has a primary key length greater than 32767. 
> HBase 1.0.0 imposes a limit on key length in the hbase-client module 
> Mutation.java at Put time (as seen in the stack traces). The T0 and T3 
> examples succeed because the long character value occurs in the value part of 
> an HBase KeyValue, not in the key part.
> The behavior above is unfriendly from a user perspective. It would be better 
> to catch the over-long key at CREATE time and raise an error there.
>  



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

Reply via email to