json type in Cassandra data model?
-
21-12-2019 - |
Question
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
Solution
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.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow