Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DynamoDB: Add software test for decoding list of objects #246

Merged
merged 1 commit into from
Aug 28, 2024

Conversation

amotl
Copy link
Member

@amotl amotl commented Aug 28, 2024

About

People reported problems converging a list of objects from DynamoDB to CrateDB. Adding a test case to evaluate the situation.

References

Comment on lines +3 to +18
RECORD_UTM = {
"Id": {"N": "101"},
"utmTags": {
"L": [
{
"M": {
"date": {"S": "2024-08-28T20:05:42.603Z"},
"utm_adgroup": {"L": [{"S": ""}, {"S": ""}]},
"utm_campaign": {"S": "34374686341"},
"utm_medium": {"S": "foobar"},
"utm_source": {"S": "google"},
}
}
]
},
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on this input data (DynamoDB table record), and a SQL DDL like

CREATE TABLE IF NOT EXISTS foobar (data OBJECT(DYNAMIC));

[...]

Comment on lines +42 to +54
results = cratedb.database.run_sql("SELECT * FROM testdrive.demo;", records=True) # noqa: S608
assert results[0]["data"] == {
"Id": 101.0,
"utmTags": [
{
"date": "2024-08-28T20:05:42.603Z",
"utm_adgroup": ["", ""],
"utm_campaign": "34374686341",
"utm_medium": "foobar",
"utm_source": "google",
}
],
}
Copy link
Member Author

@amotl amotl Aug 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.... that's the outcome that proves data converges into a CrateDB record well, afaics.

@amotl amotl marked this pull request as ready for review August 28, 2024 19:29
Copy link

@wierdvanderhaar wierdvanderhaar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let get this out.

@amotl amotl merged commit 2295b91 into main Aug 28, 2024
13 checks passed
@amotl amotl deleted the amo/dynamodb-test-list-of-objects branch August 28, 2024 19:48
@amotl
Copy link
Member Author

amotl commented Aug 28, 2024

Thanks for acknowledging. It's just a software test. No code has been adjusted, so this will not yield or need another release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants