code = 2200 [无效查询] message =“键可能不为空”

时间:2016-03-02 07:22:50

标签: python cassandra

我正在尝试插入Python字典,当我写入cassandra DB时出现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 错误。有谁知道发生了什么?

Casandra作家:

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)

实际写入cassandra:

fetch_data(some_nested_dict)

然后执行:

docker is configured to use the default machine with IP 192.168.99.100
For help getting started, check out the docs at https://docs.docker.com

my-mac:mydir$ docker run ubuntu /bin/bash
my-mac:mydir$

1 个答案:

答案 0 :(得分:0)

看起来您要么没有在所有分区键或所有群集列中插入数据。