hbase-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Izaak Rubin (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HBASE-777) Tables created from 0.2.0 shell aren't loadably by using the HTable "Text" constructor
Date Tue, 19 Aug 2008 22:46:46 GMT

    [ https://issues.apache.org/jira/browse/HBASE-777?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12623838#action_12623838

Izaak Rubin commented on HBASE-777:

I think this might be the problem: under the hood, all String/Text objects are converted to
byte[].  For Text, the Text.getBytes() method is used, which can sometimes pad on extra '\0'
characters at the end of the array.  I looked into it, and in the case of Text("RelatedAlbums")
there is a single extra '\0' character that you would not get in Bytes.toBytes("RelatedAlbums").
 My guess is that when you create the table in the new shell, the name doesn't have any padding

Another thing I should mention is that Text is slowly being faded out of HBase completely.
 0.2 is still backwards-compatible and will handle Text arguments, but the plan for 0.3 is
that Text will disappear entirely.  

Try using String instead of Text and let me know if that fixes the problem.  

I've seen a number of issues stemming from the '\0' padding in Text - if this is indeed the
problem here, I think I'll make an issue to fix 0.2 so that Text works exactly the same as
String (takes care of '\0' trimming).  

> Tables created from 0.2.0 shell aren't loadably by using the HTable "Text" constructor
> --------------------------------------------------------------------------------------
>                 Key: HBASE-777
>                 URL: https://issues.apache.org/jira/browse/HBASE-777
>             Project: Hadoop HBase
>          Issue Type: Bug
>          Components: client
>    Affects Versions: 0.2.0
>            Reporter: Todd Lipcon
>            Priority: Minor
> Using the old shell I was able to use CREATE TABLE to create a table named 'RelatedAlbums'
and then access it from Java using new HTable(conf, new Text("RelatedAlbums")).
> Using the new shell, trying to use 'create' from the irb shell and then that same constructor
results in the table not being found.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message