lib/cequel/schema/table_reader.rb
def read_partition_keys
        validator = table_data['key_validator']
        types = parse_composite_types(validator) || [validator]
        JSON.parse(table_data['key_aliases']).zip(types) do |key_alias, type|
          name = key_alias.to_sym
          table.add_partition_key(key_alias.to_sym, Type.lookup_internal(type))
        end
      end
# XXX This gets a lot easier in Cassandra 2.0: all logical columns
# (including keys) are returned from the `schema_columns` query, so
# there's no need to jump through all these hoops to figure out what the
# key columns look like.
#
# However, this approach works for both 1.2 and 2.0, so better to keep it
# for now. It will be worth refactoring this code to take advantage of
# 2.0's better interface in a future version of Cequel that targets 2.0+.
XXX This gets a lot easier in Cassandra 2.0: all logical columns
(including keys) are returned from the `schema_columns` query, so
there's no need to jump through all these hoops to figure out what the
key columns look like.

However, this approach works for both 1.2 and 2.0, so better to keep it
for now. It will be worth refactoring this code to take advantage of
2.0's better interface in a future version of Cequel that targets 2.0+.
XXX This gets a lot easier in Cassandra 2 . 0 : all logical columns ( including keys ) are returned from the ` schema_columns ` query so there ' s no need to jump through all these hoops to figure out what the key columns look like . However this approach works for both 1 . 2 and 2 . 0 so better to keep it for now . It will be worth refactoring this code to take advantage of 2 . 0 ' s better interface in a future version of Cequel that targets 2 . 0 + .
def read_partition_keys
        validator = table_data['key_validator']
        types = parse_composite_types(validator) || [validator]
        JSON.parse(table_data['key_aliases']).zip(types) do |key_alias, type|
          name = key_alias.to_sym
          table.add_partition_key(key_alias.to_sym, Type.lookup_internal(type))
        end
      end
def read_partition_keys validator = table_data [ 'key_validator' ] types = parse_composite_types ( validator ) || [ validator ] JSON . parse ( table_data [ 'key_aliases' ] ) . zip ( types ) do | key_alias , type | name = key_alias . to_sym table . add_partition_key ( key_alias . to_sym , Type . lookup_internal ( type ) ) end end
XXX This gets a lot easier in Cassandra 2.0: all logical columns
(including keys) are returned from the `schema_columns` query, so
there's no need to jump through all these hoops to figure out what the
key columns look like.
XXX This gets a lot easier in Cassandra 2 . 0 : all logical columns ( including keys ) are returned from the ` schema_columns ` query so there ' s no need to jump through all these hoops to figure out what the key columns look like .