cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nitin Pasari <nitinpas...@gmail.com>
Subject Schema not translated completely from Thrift protocol to CQL protocol
Date Tue, 01 Nov 2016 20:16:56 GMT
Hi,

I am trying to move from using pycassa to native protocol in my project
(which will let us upgrade the version of cassandra). My schema was defined
using pycassa so it created a Column family using compact storage and it
has 3 columns which are not part of the composite primary key (I know this
is not allowed by CQL protocol.)

The version of my current Cassandra cluster is 2.0.17. The schema when I do
"show schema" using the thrift protocol comes to be:

create column family store
  with column_type = 'Standard'
  and comparator =
'CompositeType(org.apache.cassandra.db.marshal.ReversedType(org.apache.cassandra.db.marshal.LongType),org.apache.cassandra.db.marshal.AsciiType,org.apache.cassandra.db.marshal.AsciiType)'
  and default_validation_class = 'DoubleType'
  and key_validation_class = 'AsciiType'
  and column_metadata = [
    {column_name : 'something1',
    validation_class : AsciiType},
    {column_name : 'something2',
    validation_class : AsciiType}]


But when I check the schema on the native protocol, it is missing "column3"
and "value" columns. It comes out as follows:

CREATE TABLE store (
  key ascii,
  column1 bigint,
  column2 ascii,
  something1 ascii,
  something2 ascii,
  PRIMARY KEY ((key), column1, column2)) WITH COMPACT STORAGE AND
  CLUSTERING ORDER BY (column1 DESC, column2 ASC)


Now, because of this discrepancy, I cannot transition from pycassa to the
native protocol on the client side. I haven't been able to find anything to
overcome this problem and make sure that the native protocol sees the right
schema. Is there anything you could suggest me to fix this? Any help is
appreciated!

Thanks,
Nitin

Mime
View raw message