brain storm
brain storm

Reputation: 31252

json type in Cassandra data model?

I am wondering if I could have json data type in the column family:

My table will have a unique row key, and column name of "tweets_json" and column value of json content.

How would I create such a table in CQL/cassandra or using python Driver or CQLengine?

tweet_json = json.encode({
                "tweet_id" : tweet_id,
                "body" : tweet_body,
                "user_name" : this_user,
                "timestamp" : timestamp
            })

Basicall

Upvotes: 1

Views: 6759

Answers (1)

ashic
ashic

Reputation: 6495

Just have a text column? If you're not looking to filter on the json, then that should be fine. If you are, then you'll need to store it as proper columns, rather than as json.

Upvotes: 3

Related Questions