Why am I getting an error when inserting rows using Net :: Cassandra :: Easy and Cassandra 0.5x?

When using the Perl Net :: Cassandra :: Easy module to interact with Cassandra, I use the following code to read columns col[123]from rows row[123]in a column family Standard1:

my $cassandra = Net::Cassandra::Easy->new(keyspace => 'Keyspace1', server => 'localhost');
$cassandra->connect();
my $result = $cassandra->get(['row1', 'row2', 'row3'], family => 'Standard1', byname => ['col1', 'col2', 'col3']);

This works as expected.

However, when trying to insert a row row1with

$result = $cassandra->mutate(['row1'], family => 'Standard1', insertions => { "col1" => "Value to set." });

.. I get an error Can't use string ("0") as a SCALAR ref while "strict refs" in use at .../Net/GenThrift/Thrift/BinaryProtocol.pm line 376.

What am I doing wrong?

+3
source share
3 answers

The code works as expected under Cassandra 0.6.x, but does not work under Cassandra 0.5.x.

, Net::Cassandra::Easy Cassandra 0.6.x.

Cassandra 0.6.x .

+3

:

sub readByte
{
    my $self  = shift;
    my $value = shift;

    my $data = $self->{trans}->readAll(1);
    my @arr = unpack('c', $data);
    $$value = $arr[0];    # <~ line 376
    return 1;
}

( Net::GenThrift::Thrift::BinaryProtocol)

-, - - , $value , . .

+3

hmm, Perl .

, 0.6 , , 0.6 , . JIRA, , :

https://issues.apache.org/jira/browse/THRIFT-758

+1

Source: https://habr.com/ru/post/1737948/


All Articles