Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Long data type is not supported #30

Open
swatidhoke opened this issue Mar 21, 2013 · 5 comments
Open

Long data type is not supported #30

swatidhoke opened this issue Mar 21, 2013 · 5 comments

Comments

@swatidhoke
Copy link

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

@dmcnelis
Copy link

As a short term fix, if you can use CQL for your inserts, it bypasses the problem.

@swatidhoke
Copy link
Author

but i m trying to get data where row key is defined as long type ..will this still be useful

@dmcnelis
Copy link

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.

@mkjellman
Copy link
Owner

LongType works for us, could you post a sample schema for a CF to test against?

@swatidhoke
Copy link
Author

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' );

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants