According to DynamoDB API, index hash key must coincide with table hash key, but now we can create a table with index, which hash key differs from table hash key:
2014-04-17 11:16:38,710 Request: POST http://127.0.0.1:8480/v1/default_tenant/data/tables
2014-04-17 11:16:38,711 Request Headers: {'Content-Type': 'application/json', 'Accept': 'application/json'}
2014-04-17 11:16:38,711 Request Body: {"local_secondary_indexes": [{"key_schema": [{"key_type": "HASH", "attribute_name": "attr_name1"}, {"key_type": "RANGE", "attribute_name": "attr_name2"}], "index_name": "index_name", "projection": {"projection_type": "ALL"}}], "key_schema": [{"key_type": "HASH", "attribute_name": "forum"}, {"key_type": "RANGE", "attribute_name": "subject"}], "table_name": "testtempest700888849", "attribute_definitions": [{"attribute_type": "S", "attribute_name": "forum"}, {"attribute_type": "S", "attribute_name": "subject"}, {"attribute_type": "S", "attribute_name": "attr_name1"}, {"attribute_type": "S", "attribute_name": "attr_name2"}]}
2014-04-17 11:16:39,766 Response Status: 200
2014-04-17 11:16:39,767 Response Headers: {'date': 'Thu, 17 Apr 2014 11:16:39 GMT', 'content-length': '994', 'content-type': 'application/json'}
2014-04-17 11:16:39,767 Response Body: {"table_description": {"key_schema": [{"key_type": "HASH", "attribute_name": "forum"}, {"key_type": "RANGE", "attribute_name": "subject"}], "creation_date_time": 0, "links": [{"href": "http://127.0.0.1:8480/v1/default_tenant/data/tables/testtempest700888849", "rel": "self"}, {"href": "http://127.0.0.1:8480/v1/default_tenant/data/tables/testtempest700888849", "rel": "bookmark"}], "local_secondary_indexes": [{"index_size_bytes": 0, "key_schema": [{"key_type": "HASH", "attribute_name": "forum"}, {"key_type": "RANGE", "attribute_name": "attr_name2"}], "index_name": "index_name", "projection": {"projection_type": "ALL"}, "item_count": 0}], "table_name": "testtempest700888849", "table_size_bytes": 0, "table_status": "ACTIVE", "attribute_definitions": [{"attribute_type": "S", "attribute_name": "attr_name2"}, {"attribute_type": "S", "attribute_name": "attr_name1"}, {"attribute_type": "S", "attribute_name": "forum"}, {"attribute_type": "S", "attribute_name": "subject"}], "item_count": 0}}
Fix proposed to branch: master /review. openstack. org/114556
Review: https:/