Reputation: 2328
I'm trying to insert a Python dictionary and I got the code=2200 [Invalid query] message="Key may not be empty"
error when I was writing to cassandra DB. Do anyone have an idea what's going on?
Casandra writer:
def writer(**kwargs):
try:
openEventStream.create(
venue_name = get_dict_val(kwargs, 'venue_name'),
venue_lon = get_dict_val(kwargs, 'venue_lon'),
....
)
except Exception, e:
print e
Actually write into cassandra:
def fetch_data(messages):
for message in messages:
# venue
venue = get_dict_val(message, 'venue')
if venue:
venue_name = get_dict_val(venue, 'venue_name')
venue_lon = get_dict_val(venue, 'venue_lon')
...
else:
venue_name, venue_lon = None, None
writer(venue_name = venue_name, venue_lon = venue_lon)
then execute:
fetch_data(some_nested_dict)
Upvotes: 1
Views: 3210
Reputation: 379
It looks like either you are not inserting data in your all the partition key or in all the clustering column.
Upvotes: 1