mboudreau/Alternator — pull request #71 by vdenisov (2013-08-10 20:09:19+00:00)
Title: Improvements to scan requests

Hello,

When working with Alternator, I'd ran into three issues specific to my code:

1. For scan requests with multiple conditions (such as two EQ's on different attributes), Alternator would return multiple copies of the same item (one for each matching condition).
2. When updating an item with ADD on an integer-valued number attribute, Alternator would convert it to double (i.e., "1" + "2" = "3.0"); subsequent mappings of this to an int field by DynamoDBMapper would fail.
3. Since comparisons were (mostly) performed on strings, I ran into issues with number attributes - "120" is less than "50" when compared this way :-(.

Fixing 1 and 2 was easy (see 9845080 and a1a0957). Fixing 3 in a non-ugly way required a significant rework of the scan() method's code. As a side-effect, it's now more spec-compliant (i.e., it won't add number attributes for BEGINS_WITH condition), but the changes are much more severe than for the first two cases.

Hope you would find this contribution helpful.

Regards,
Victor Denisov.