def _analyze_table(self):
# First check the Key Schema
if len(self.table.key_schema) != 1:
LOG.info('cruddy does not support RANGE keys')
else:
self._indexes[self.table.key_schema[0]['AttributeName']] = None
# Now process any GSI's
if self.table.global_secondary_indexes:
for gsi in self.table.global_secondary_indexes:
# find HASH of GSI, that's all we support for now
# if the GSI has a RANGE, we ignore it for now
if len(gsi['KeySchema']) == 1:
gsi_hash = gsi['KeySchema'][0]['AttributeName']
self._indexes[gsi_hash] = gsi['IndexName']
# Because the Boto3 DynamoDB client turns all numeric types into Decimals
# (which is actually the right thing to do) we need to convert those
# Decimal values back into integers or floats before serializing to JSON.
评论列表
文章目录