Grokbase Groups HBase dev May 2011
FAQ
Hi,

I am running the PHP DemoClient and it is supposed to bail out on an
invalid UTF-8 string, but that now passes and triggers the Jedi "You
should not be here!" waving.

The string is

#
# Test UTF-8 handling
#
$invalid = "foo-\xfc\xa1\xa1\xa1\xa1\xa1";
$valid = "foo-\xE7\x94\x9F\xE3\x83\x93\xE3\x83\xBC\xE3\x83\xAB";

and the code

# non-utf8 is not allowed in row names
try {
$mutations = array(
new Mutation( array(
'column' => 'entry:foo',
'value' => $invalid
) ),
);
$client->mutateRow( $t, $invalid, $mutations );
throw new Exception( "shouldn't get here!" );
} catch ( IOError $e ) {
echo( "expected error: {$e->message}\n" );
}

Looking at the shell I see:

hbase(main):006:0> scan 'demo_table'
ROW COLUMN+CELL
column=entry:,
timestamp=1306229854784, value=
foo column=entry:foo,
timestamp=1306229854782, value=foo-\xFC\xA1\xA1\xA1\xA1\xA1
foo-\xE7\x94\x9F\xE3\x83\x93\xE3\x83\x column=entry:foo,
timestamp=1306229854787,
value=foo-\xE7\x94\x9F\xE3\x83\x93\xE3\x83\xBC\xE3\x83\xAB
BC\xE3\x83\xAB
foo-\xFC\xA1\xA1\xA1\xA1\xA1 column=entry:foo,
timestamp=1306229854789, value=foo-\xFC\xA1\xA1\xA1\xA1\xA1
4 row(s) in 0.0430 seconds

So it happily created the row key. Did we "fix" the allowed character handling?

Lars

Search Discussions

  • Moaz Reyad at Jun 16, 2011 at 4:41 pm
    The C++ and Java demos are fixed in these tickets :

    https://issues.apache.org/jira/browse/HBASE-3593
    https://issues.apache.org/jira/browse/HBASE-3630

    Other demo files in PHP, Ruby, Python , ..etc probably need to be fixed in
    the same way.

    Moaz
    On Tue, May 24, 2011 at 11:50 AM, Lars George wrote:

    Hi,

    I am running the PHP DemoClient and it is supposed to bail out on an
    invalid UTF-8 string, but that now passes and triggers the Jedi "You
    should not be here!" waving.

    The string is

    #
    # Test UTF-8 handling
    #
    $invalid = "foo-\xfc\xa1\xa1\xa1\xa1\xa1";
    $valid = "foo-\xE7\x94\x9F\xE3\x83\x93\xE3\x83\xBC\xE3\x83\xAB";

    and the code

    # non-utf8 is not allowed in row names
    try {
    $mutations = array(
    new Mutation( array(
    'column' => 'entry:foo',
    'value' => $invalid
    ) ),
    );
    $client->mutateRow( $t, $invalid, $mutations );
    throw new Exception( "shouldn't get here!" );
    } catch ( IOError $e ) {
    echo( "expected error: {$e->message}\n" );
    }

    Looking at the shell I see:

    hbase(main):006:0> scan 'demo_table'
    ROW COLUMN+CELL
    column=entry:,
    timestamp=1306229854784, value=
    foo column=entry:foo,
    timestamp=1306229854782, value=foo-\xFC\xA1\xA1\xA1\xA1\xA1
    foo-\xE7\x94\x9F\xE3\x83\x93\xE3\x83\x column=entry:foo,
    timestamp=1306229854787,
    value=foo-\xE7\x94\x9F\xE3\x83\x93\xE3\x83\xBC\xE3\x83\xAB
    BC\xE3\x83\xAB
    foo-\xFC\xA1\xA1\xA1\xA1\xA1 column=entry:foo,
    timestamp=1306229854789, value=foo-\xFC\xA1\xA1\xA1\xA1\xA1
    4 row(s) in 0.0430 seconds

    So it happily created the row key. Did we "fix" the allowed character
    handling?

    Lars

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupdev @
categorieshbase, hadoop
postedMay 24, '11 at 9:51a
activeJun 16, '11 at 4:41p
posts2
users2
websitehbase.apache.org

2 users in discussion

Moaz Reyad: 1 post Lars George: 1 post

People

Translate

site design / logo © 2022 Grokbase