0

pycassa でこれらの CLI コマンドと同等の処理を実行したい:

CREATE COLUMN FAMILY users
WITH comparator = UTF8Type
AND key_validation_class=UTF8Type
AND column_metadata = [
{column_name: full_name, validation_class: UTF8Type}
{column_name: email, validation_class: UTF8Type}
{column_name: state, validation_class: UTF8Type}
{column_name: gender, validation_class: UTF8Type}
{column_name: birth_year, validation_class: LongType}
];

pycassaの同等性は何ですか? ありがとう

4

2 に答える 2

2

これを試すことができます。Pythonクライアントについてはまだよくわかりません...

 validators = {'full_name': UTF8_TYPE,
              'email': UTF8_TYPE,
              'state': UTF8_TYPE,
              'gender': UTF8_TYPE,
              'birth_year': LONG_TYPE}
 sys.create_column_family('TestKeyspace', 'TestCF', super=False,
              comparator_type=UTF8Type,
              key_validation_class=UTF8Type, 
              column_validation_classes=validators)
于 2013-05-07T18:49:48.527 に答える