Uploaded image for project: 'Apache Trafodion (Retired)'
  1. Apache Trafodion (Retired)
  2. TRAFODION-2977

Trafodion allows creating objects with longer key lengths than HBase supports

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.3
    • 2.3
    • sql-cmp
    • None

    Description

      The following illustrates the problem:

      >>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.
      >>

       

      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.

       

      Attachments

        Issue Links

          Activity

            People

              dbirdsall Dave Birdsall
              dbirdsall Dave Birdsall
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: