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

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

GitHub user DaveBirdsall opened a pull request:

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

    [TRAFODION-3005] Fix issues with keys on long columns

    This is a follow-on to JIRA TRAFODION-2977 (pull request 
https://github.com/apache/trafodion/pull/1473).
    
    I made two changes here.
    
    1. In the previous pull request, I added a check to the CREATE INDEX logic 
to make sure the key length is not too long. I put that check too early in the 
logic. I have now moved that check to the proper place.
    
    2. It turns out that HBase uses rowIDs + possibly the HBase object name + 
some other info to make entries into another HBase structure internally, and 
imposes a 32767 key length limit on that. Unfortunately when we exceed the 
length limit on that internal structure, the HBase application (Trafodion in 
our case) experiences a hang. To avoid these hangs, we will further restrict 
maximum key length in Trafodion to 32000. The code change contains a detailed 
explanation of how this number was arrived at.

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

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

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

    https://github.com/apache/trafodion/pull/1494.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 #1494
    
----
commit 9c935c529c112afe889a05c5f9aa3498a16a2fac
Author: Dave Birdsall <dbirdsall@...>
Date:   2018-03-22T18:58:38Z

    [TRAFODION-3005] Fix issues with keys on long columns

----


> CREATE INDEX on certain long chars fails with Java exceptions
> -------------------------------------------------------------
>
>                 Key: TRAFODION-3005
>                 URL: https://issues.apache.org/jira/browse/TRAFODION-3005
>             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 session illustrates the issue. Creating an index on a 
> CHAR(32757) succeeds. Creating an index on a CHAR(32766) fails with a good 
> error message (1141). But creating an index on intermediate sizes fails with 
> a Java exception, pointing to some bug with near-boundary conditions.
> {{>>drop table if exists mytable;}}{{--- SQL operation complete.}}
> {{>>create table mytable (}}
> {{+>c1 char(32757),}}
> {{+>c2 char(32758),}}
> {{+>c3 char(32765),}}
> {{+>c4 char(32766));}}{{--- SQL operation complete.}}
> {{>>insert into mytable values ('A','A','A','A');}}{{--- 1 row(s) inserted.}}
> {{>>create index idx1 on mytable (c1);}}{{--- SQL operation complete.}}
> {{>>create index idx2 on mytable (c2);}}{{*** ERROR[8448] Unable to access 
> Hbase interface. Call to ExpHbaseInterface::addToHFile returned error 
> HBASE_ADD_TO_HFILE_ERROR(-713). Cause: java.lang.NegativeArraySizeException}}
> {{org.trafodion.sql.HBulkLoadClient.addToHFile(HBulkLoadClient.java:247).}}
> {{*** ERROR[1081] Loading of index TRAFODION.SCH.IDX2 failed unexpectedly.}}
> {{--- SQL operation failed with errors.}}
> {{>>create index idx3 on mytable (c3);}}
> {{*** ERROR[8448] Unable to access Hbase interface. Call to 
> ExpHbaseInterface::addToHFile returned error HBASE_ADD_TO_HFILE_ERROR(-713). 
> Cause: java.lang.NegativeArraySizeException}}
> {{org.trafodion.sql.HBulkLoadClient.addToHFile(HBulkLoadClient.java:247).}}
> {{*** ERROR[1081] Loading of index TRAFODION.SCH.IDX3 failed unexpectedly.}}
> {{--- SQL operation failed with errors.}}
> {{>>create index idx4 on mytable (c4);}}
> {{*** ERROR[1141] Key length 32768 exceeds the maximum allowed key length of 
> 32767.}}
> {{--- SQL operation failed with errors.}}
> {{>>}}



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

Reply via email to