Joey Yi Zhao
Joey Yi Zhao

Reputation: 42634

How can I get the size of items returned by scan dynamodb table?

Dynamodb has a limitation on query that the maximum item is 1MB for a single query. How can I get the total item size from a query I send to dynamodb?

Upvotes: 1

Views: 1061

Answers (2)

Duncan Skilton
Duncan Skilton

Reputation: 56

If it's the item count you want, you can use scanResult.getCount().

If you want the size of each scanRequest, you could write each request to a text file and, when the scan is complete, check the file sizes.

Upvotes: 1

Charles
Charles

Reputation: 23823

You can't.

Best you could do would be to estimate it by counting how many calls to Query() you make till LastEvaluatedKey is empty in the response; which indicates the last page of data as been returned.

If all your DDB entries are the same size you could total up Count/Scanned Count as you make the repeated calls to Query().

Upvotes: 0

Related Questions