mapbox / mapbox/dyno

export | import doesnt load data, only creates table

Open
#132 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
79
Forks
27
PR merge metrics
No merged PRs in 30d

Description

ok, I've been banging my head on this too long now.

Simple summary - `import` (and `put`) dont actually load data into ddb.

I've also tested this with `put` (removing the first line that contains the table schema from the export) after creating a table, with the same result. empty stdout/stderr, and no data added to ddb.

running v1.4.1 code:

```
%% dyno export us-west-2/dsr-test
{"AttributeDefinitions":[{"AttributeName":"user","AttributeType":"S"}],"TableName":"dsr-test","KeySchema":[{"AttributeName":"user","KeyType":"HASH"}],"ProvisionedThroughput":{"ReadCapacityUnits":8,"WriteCapacityUnits":2},"TableArn":"arn:aws:dynamodb:us-west-2:569641690693:table/dsr-test"}
{"user":{"S":"testser"}}
{"user":{"S":"teetst"}}

%% dyno export us-west-2/dsr-test | dyno import us-west-2/dsr-test-restore-1

%% dyno export us-west-2/dsr-test-restore-1
{"AttributeDefinitions":[{"AttributeName":"user","AttributeType":"S"}],"TableName":"dsr-test-restore-1","KeySchema":[{"AttributeName":"user","KeyType":"HASH"}],"ProvisionedThroughput":{"ReadCapacityUnits":8,"WriteCapacityUnits":2},"TableArn":"arn:aws:dynamodb:us-west-2:569641690693:table/dsr-test-restore-1"}

%%

```

The tests added in #117 for #96 seem to pass:

```
cheese:~/git/github/dyno-clone((v1.4.1))%% npm uninstall
cheese:~/git/github/dyno-clone((v1.4.1))%% npm install
cheese:~/git/github/dyno-clone((v1.4.1))%% export PATH="$(npm bin):$PATH"
cheese:~/git/github/dyno-clone((v1.4.1))%% node test/cli.test.js
...
# [cli] export --> import roundtrip
ok 31 cli success
ok 32 cli success
ok 33 loaded records into table
```

and using the direct code (vs the npm installed package) has the same result:

```
cheese:~/git/github/dyno-clone((v1.4.1))%% node bin/cli.js export us-west-2/dsr-test
{"AttributeDefinitions":[{"AttributeName":"user","AttributeType":"S"}],"TableName":"dsr-test","KeySchema":[{"AttributeName":"user","KeyType":"HASH"}],"ProvisionedThroughput":{"ReadCapacityUnits":8,"WriteCapacityUnits":2},"TableArn":"arn:aws:dynamodb:us-west-2:569641690693:table/dsr-test"}
{"user":{"S":"testser"}}
{"user":{"S":"teetst"}}

cheese:~/git/github/dyno-clone((v1.4.1))%% node bin/cli.js export us-west-2/dsr-test | node bin/cli.js import us-west-2/dsr-test-restore-3

cheese:~/git/github/dyno-clone((v1.4.1))%% node bin/cli.js export us-west-2/dsr-test-restore-3
{"AttributeDefinitions":[{"AttributeName":"user","AttributeType":"S"}],"TableName":"dsr-test-restore-3","KeySchema":[{"AttributeName":"user","KeyType":"HASH"}],"ProvisionedThroughput":{"ReadCapacityUnits":8,"WriteCapacityUnits":2},"TableArn":"arn:aws:dynamodb:us-west-2:569641690693:table/dsr-test-restore-3"}

cheese:~/git/github/dyno-clone((v1.4.1))%%
```

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with bin/cli.js and the export/import roundtrip in test/cli.test.js, then reproduce the pipe shown in the report against a DynamoDB table. Confirm that the restored table contains the exported records and that the existing roundtrip test still passes.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, javascript
Domain
cli, database
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.