David Wayne Birdsall created TRAFODION-2977:
-----------------------------------------------
Summary: 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
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)