mapbox / dyno

simple dynamodb client
MIT License
78 stars 31 forks source link

`dyno import` does not seem to work #96

Closed tuscland closed 8 years ago

tuscland commented 8 years ago

Hello,

Using dyno export produce a file whose first line is the table definition and other lines are the contents of the table. Unfortunately dyno fails to parse the first line because it expect dynamodb types as in the following lines.

Has anyone already used dyno import successfully?

All the best, Cam

rclark commented 8 years ago

Hi! dyno import ought to use that first line to create a table that matches the exported schema. Can you provide a stack trace for the error you're seeing when you tried to run the import command?

tuscland commented 8 years ago

Hello!

Here it is:

nightfly:20150915 camille$ cat dumps-production/cex_production_catalog.dump | dyno import local/cex_development_catalog

/usr/local/lib/node_modules/dyno/node_modules/dynamodb-doc/lib/datatypes.js:304
                throw "Service returned unrecognized datatype " + key;
                                                                ^
Service returned unrecognized datatype 0

The dump was produced with dyno export.

Here is a sample of the data in the dump:

{"AttributeDefinitions":[{"AttributeName":"id","AttributeType":"S"}],"KeySchema":[{"AttributeName":"id","KeyType":"HASH"}],"ProvisionedThroughput":{"ReadCapacityUnits":1,"WriteCapacityUnits":1},"TableName":"cex_production_catalog"}
{"id":{"S":"1a3a04ce-05e9-4033-8858-4cb8df12cfdf"},"creation_date":{"S":"2015-08-11T16:35:29.308Z"},"last_update_date":{"S":"2015-08-11T16:35:29.308Z"},"source_version":{"N":"2"},"current_version":{"N":"0"},"is_active":{"BOOL":false},"source_id":{"S":"5biyvdxk"},"name":{"S":"Example Catalog"},"source_type":{"S":"Dynamotron3000"}}
rclark commented 8 years ago

Been a while, but I'm going to pick this up again -- I'll write a test for round-trip export --> import and see what falls out.