Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does "Unable to find storage information for property" mean when using DynamoDB?

I'm running a scan using the .NET SDK for AWS DynamoDB. I'm doing this:

var result = context.Scan<Table>(new[] { new ScanCondition("AttributeName", ScanOperator.Equal, variable) }

This throws the exception

"Unable to find storage information for property [AttributeName]"

The attribute AttributeName is a non-indexed attribute that currently has mostly no value in it (it's a new attribute I added recently).

I googled the error & all I came up with was the sdk source code, which I could dive into, and I will if noone here can enlighten me.

like image 603
Glenn Slaven Avatar asked Dec 27 '13 09:12

Glenn Slaven


People also ask

How is data stored in a DynamoDB table?

Amazon DynamoDB stores data in partitions. A partition is an allocation of storage for a table, backed by solid state drives (SSDs) and automatically replicated across multiple Availability Zones within an AWS Region.

Is DynamoDB in-memory or on disk?

On the other hand, Amazon DynamoDB Accelerator (DAX) is a fully managed, highly available, in-memory cache for Amazon DynamoDB that delivers up to a 10 times performance improvement—from milliseconds to microseconds—even at millions of requests per second.

What type of data is stored in DynamoDB?

DynamoDB supports the Java Set , List , and Map collection types. The following table summarizes how these Java types map to the DynamoDB types. BOOL (Boolean type), 0 or 1. S (string type).


2 Answers

The DynamoDBContext.Scan<T>() method only accepts names of public properties of the class T that is mapped to that table using the [DynamoDBTable()] attribute. Scan<T> will not recognize unmapped attributes in the table.

That exception will be thrown if the class T either doesn't have a public property of that name, or if the property is explicitly marked [DynamoDBIgnore].

If you need to scan the table for table attributes that are not modeled, you can use the low-level API provided by AmazonDynamoDBClient.Scan(), but it won't return objects of type T.

like image 68
Jim Flanagan Avatar answered Oct 10 '22 01:10

Jim Flanagan


This got me too, sharing my findings hoping it could help someone, I am using C# Object persistent model.

Column names in DynamoDb are in Camel case. C# class properties are not.

[DynamoDBProperty("artist")]
    [DynamoDBHashKey]
    public string Artist { get; set; }

    [DynamoDBProperty("songTitle")]
    [DynamoDBRangeKey]
    public string SongTitle { get; set; }
    

Therefore following throws the error,

scanConditions.Add(new ScanCondition("songTitle", ScanOperator.BeginsWith, searchReq.SongTitle));
            if (!string.IsNullOrEmpty(searchReq.Difficulty))

To fix,

scanConditions.Add(new ScanCondition("SongTitle", ScanOperator.BeginsWith, searchReq.SongTitle));
            if (!string.IsNullOrEmpty(searchReq.Difficulty))
like image 23
Dhanuka777 Avatar answered Oct 10 '22 02:10

Dhanuka777