user3368526
user3368526

Reputation: 2328

code=2200 [Invalid query] message="Key may not be empty"

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

Answers (1)

sachin
sachin

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

Related Questions