I'm trying to use cassandra to connect with Meetup streaming api through kafka. cqlengine
seems like that it was an separated project before and the reference code that I am using is made around that time.
So before, cqlengine.management
had create_keyspace
Now, cassandra.cqlengine.management
has create_keyspace_simple
I am trying to create keyspace.
create_keyspace_simple('meetup', 'SimpleStrategy', 1)
However, then I got this error. Warning:
/Users/a/anaconda/lib/python2.7/site-packages/cassandra/cqlengine/management.py:419: UserWarning: CQLENG_ALLOW_SCHEMA_MANAGEMENT environment variable is not set. Future versions of this package will require this variable to enable management functions.
warnings.warn(msg)
Error:
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-17-45553511338c> in <module>()
1 # create keyspace
2 # keyspace name, keyspace replication strategy, replication factor
----> 3 create_keyspace_simple('meetup', 'SimpleStrategy', 1)
/Users/a/anaconda/lib/python2.7/site-packages/cassandra/cqlengine/management.pyc in create_keyspace_simple(name, replication_factor, durable_writes)
54 """
55 _create_keyspace(name, durable_writes, 'SimpleStrategy',
---> 56 {'replication_factor': replication_factor})
57
58
/Users/a/anaconda/lib/python2.7/site-packages/cassandra/cqlengine/management.pyc in _create_keyspace(name, durable_writes, strategy_class, strategy_options)
84 log.info("Creating keyspace %s ", name)
85 ks_meta = metadata.KeyspaceMetadata(name, durable_writes, strategy_class, strategy_options)
---> 86 execute(ks_meta.as_cql_query())
87 else:
88 log.info("Not creating keyspace %s because it already exists", name)
/Users/a/anaconda/lib/python2.7/site-packages/cassandra/metadata.so in cassandra.metadata.KeyspaceMetadata.as_cql_query (cassandra/metadata.c:17371)()
AttributeError: 'NoneType' object has no attribute 'export_for_schema'