perlcassa
perlcassa copied to clipboard
Long data type is not supported
Hi Micheal ,
I am trying to use Perl module -Perlcassa
My Use Case is : Fetch a query from Cassandra using perl through get and get_slice where rowkey is defined as longtype.
Issue : Row_key value described in table is long type whereas cassandra.pm module is sending it as a string.
Error on running script: $VAR1 = bless( { 'why' => 'Expected 8 or 0 byte long (11)' }, 'Cassandra::InvalidRequestException' );
Column family description of Cassandra:
create column family Users with column_type = 'Standard' and comparator = 'UTF8Type' and default_validation_class = 'BytesType' and key_validation_class = 'LongType' and read_repair_chance = 0.1 and dclocal_read_repair_chance = 0.0 and gc_grace = 864000 and min_compaction_threshold = 4 and max_compaction_threshold = 32 and replicate_on_write = true and compaction_strategy = 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy' and caching = 'KEYS_ONLY' and column_metadata = [ {column_name : 'st', validation_class : BytesType}, {column_name : 'pwrCalUsr', validation_class : BooleanType}, {column_name : 'photoURL', validation_class : UTF8Type}, {column_name : 'uNm', validation_class : UTF8Type}, {column_name : 'netIDs', validation_class : UTF8Type}, {column_name : 'pronoun', validation_class : UTF8Type}, {column_name : 'wrkRmNo', validation_class : UTF8Type}, {column_name : 'handle', validation_class : UTF8Type}, {column_name : 'mNm', validation_class : UTF8Type}, {column_name : 'clntPw', validation_class : UTF8Type}, {column_name : 'lNm', validation_class : UTF8Type}, {column_name : 'availId', validation_class : IntegerType}, {column_name : 'atMobile', validation_class : BooleanType}, {column_name : 'tmZn', validation_class : UTF8Type}, {column_name : 'hmAddr', validation_class : UTF8Type}, {column_name : 'inMeeting', validation_class : BooleanType}, {column_name : 'wrkAddr', validation_class : UTF8Type}, {column_name : 'fNm', validation_class : UTF8Type}, {column_name : 'onThePhone', validation_class : BooleanType}, {column_name : 'dept', validation_class : UTF8Type}, {column_name : 'lstModTm', validation_class : DateType}, {column_name : 'presence', validation_class : UTF8Type}, {column_name : 'uId', validation_class : LongType}, {column_name : 'title', validation_class : UTF8Type}, {column_name : 'supervisorPersonID', validation_class : IntegerType}, {column_name : 'co', validation_class : UTF8Type}, {column_name : 'available', validation_class : BooleanType}, {column_name : 'offline', validation_class : BooleanType}, {column_name : 'crTm', validation_class : DateType}, {column_name : 'availty', validation_class : IntegerType}, {column_name : 'presenceId', validation_class : IntegerType}, {column_name : 'winTmZn', validation_class : UTF8Type}, {column_name : 'empId', validation_class : UTF8Type}, {column_name : 'photoID', validation_class : IntegerType}] and compression_options = {'sstable_compression' : 'org.apache.cassandra.io.compress.SnappyCompressor'};
Thanks, Swati
As a short term fix, if you can use CQL for your inserts, it bypasses the problem.
but i m trying to get data where row key is defined as long type ..will this still be useful
I have the same thing going on. Can't use $obj->insert at the moment with the key as a LongType, but it works just fine through CQL.
Though I am inserting, not trying to pull with perlcassa...I'd not read your use case carefully enough.
LongType works for us, could you post a sample schema for a CF to test against?
I have posted the column family used in the issue ..i m just trying to use get and get_slice to fetch data , which gives me below error: Error on running script: $VAR1 = bless( { 'why' => 'Expected 8 or 0 byte long (11)' }, 'Cassandra::InvalidRequestException' );