mirror of
https://github.com/scylladb/scylladb.git
synced 2026-04-24 18:40:38 +00:00
A CreateTable request defines the KeySchema of the base table and each of its GSIs and LSIs. It also needs to give an AttributeDefinition for each attribute used in a KeySchema - which among other things specifies this attribute's type (e.g., S, N, etc.). Other, non-key, attributes *do not* have a specified type, and accordingly must not be mentioned in AttributeDefinitions. Before this patch, Alternator just ignored unused AttributeDefinitions entries, whereas DynamoDB throws an error in this case. This patch fixes Alternator's behavior to match DynamoDB's - and adds a test to verify this. Besides being more error-path-compatible with DynamoDB, this extra check can also help users: We already had one user complaining that an AttributeDefinitions setting he was using was ignored, not realizing that it wasn't used by any KeySchema. A clear error message would have saved this user hours of investigation. Fixes #19784. Signed-off-by: Nadav Har'El <nyh@scylladb.com> Closes scylladb/scylladb#20378