Disable autopacking of values to binary

11 views
Skip to first unread message

utkar...@gmail.com

unread,
Mar 25, 2013, 3:18:22 PM3/25/13
to pycassa...@googlegroups.com
Hello,

I have a usecase where I need to disable the autopacking of values from string to binary and need to store all the data as is (as string).
I understand this is not recommended, but I need this for testing a feature.

I tried this:
            self.destination_cf = ColumnFamily(destination_pool,
                                                                args["column_family"])
            self.destination_cf.autopack_names = False
            self.destination_cf.autopack_values = False
            self.destination_cf.autopack_keys = False
            self.destination_cf.default_validation_class = pycassa.types.UTF8Type()

But this does not work. Any suggestions?


Thanks,
-Utkarsh

Tyler Hobbs

unread,
Mar 25, 2013, 3:52:52 PM3/25/13
to pycassa...@googlegroups.com
How is it not working?  What operation are you trying and what is the error (or expected result and actual result)?



--
You received this message because you are subscribed to the Google Groups "pycassa-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pycassa-discu...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Tyler Hobbs
DataStax

Utkarsh Sengar

unread,
Mar 25, 2013, 4:17:26 PM3/25/13
to pycassa...@googlegroups.com
I am simply doing an insert: self.destination_cf.insert(key, value) and the source of the data (from another cassandra instance) does not have data in binary format.

When I query my source cassandra instance via cli, I see the values as expected (in string format).
After I run the import and same data is copied to another cassandra instance, I see hex values.

Thanks,
-Utkarsh


--
You received this message because you are subscribed to a topic in the Google Groups "pycassa-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pycassa-discuss/hc1UEnGAzI8/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to pycassa-discu...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Thanks,
-Utkarsh

Tyler Hobbs

unread,
Mar 25, 2013, 5:17:12 PM3/25/13
to pycassa...@googlegroups.com

On Mon, Mar 25, 2013 at 3:17 PM, Utkarsh Sengar <utkar...@gmail.com> wrote:

When I query my source cassandra instance via cli, I see the values as expected (in string format).
After I run the import and same data is copied to another cassandra instance, I see hex values.

It sounds like the destination cluster is using BytesType, correct? If so, cassandra-cli displays BytesType data in hex by default.


--
Tyler Hobbs
DataStax

Utkarsh Sengar

unread,
Mar 25, 2013, 5:42:16 PM3/25/13
to pycassa...@googlegroups.com
Ah I see. How can I change the value from ByteType to something else?
Basically I am trying to keep the source cluster data partially in sync with my local instance.

-Utkarsh


--
You received this message because you are subscribed to a topic in the Google Groups "pycassa-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pycassa-discuss/hc1UEnGAzI8/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to pycassa-discu...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Thanks,
-Utkarsh

Tyler Hobbs

unread,
Mar 25, 2013, 7:09:11 PM3/25/13
to pycassa...@googlegroups.com

On Mon, Mar 25, 2013 at 4:42 PM, Utkarsh Sengar <utkar...@gmail.com> wrote:
Ah I see. How can I change the value from ByteType to something else?

See "help update column family;" in cassandra-cli.  Note that you won't be able to change the comparator after the column family is created.


--
Tyler Hobbs
DataStax
Reply all
Reply to author
Forward
0 new messages