python 使用pycassa 链接cassandra 获取数据

KEYSPACE1' = pycassa.ConnectionPool('KEYSPACE1') COLUMNFAMILY1 = pycassa.ColumnFamily(KEYSPACE1', 'COLUMNFAMILY1') #va=COLUMNFAMILY1.get('test1')  默认只取前100行 va=COLUMNFAMILY1.get('test1',column_count=300)


http://pycassa.github.io/pycassa/api/pycassa/columnfamily.html#pycassa.columnfamily.ColumnFamily.get


get(key[, columns][, column_start][, column_finish][, column_reversed][, column_count][, include_timestamp][, super_column][, read_consistency_level]) 
Fetches all or part of the row with key key. 
The columns fetched may be limited to a specified list of column names using columns.
 Alternatively, you may fetch a slice of columns or super columns from a row using column_start, column_finish, and column_count. Setting these will cause columns or super columns to be fetched starting with column_start, continuing until column_count columns or super columns have been fetched or column_finish is reached. If column_start is left as the empty string, the slice will begin with the start of the row; leaving column_finishblank will cause the slice to extend to the end of the row. Note that column_count defaults to 100, so rows over this size will not be completely fetched by default.
 If column_reversed is True, columns are fetched in reverse sorted order, beginning with column_start. In this case, if column_start is the empty string, the slice will begin with the end of the row. 
You may fetch all or part of only a single super column by setting super_column. If this is set, column_start, column_finish, column_count, andcolumn_reversed will apply to the subcolumns of super_column.
 To include every column’s timestamp in the result set, set include_timestamp to True. Results will include a (value, timestamp) tuple for each column. 
If this is a standard column family, the return type is of the form {column_name: column_value}. If this is a super column family and super_column is not specified, the results are of the form {super_column_name: {column_name, column_value}}. If super_column is set, the super column name will be excluded and the results are of the form {column_name: column_value}.

你可能感兴趣的:(python,cassandra,pycassa)