Logo F2FInterview

Pycassa Interview Questions

Q   |   QA

pycassaShell is an interactive Python shell that is included with pycassa. Upon starting, it sets up many of the objects that you typically work with when using pycassa. It provides most of the functionality that cassandra-cli does, but also gives you a full Python environment to work with.

Here’s how to create the keyspace and column family:

import pycassa
from pycassa import system_manager
from pycassa.columnfamily import ColumnFamily

sys = system_manager.SystemManager('localhost:9160')

sys.create_keyspace('Keyspace1', system_manager.SIMPLE_STRATEGY, {'replication_factor': '1'})
sys.create_column_family('Keyspace1', 'ColumnFamily1')

In order to link this F2FInterview's page as Reference on your website or Blog, click on below text area and pres (CTRL-C) to copy the code in clipboard or right click then copy the following lines after that paste into your website or Blog.

Get Reference Link To This Page: (copy below code by (CTRL-C) and paste into your website or Blog)
HTML Rendering of above code: