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: Apply rough type evaluation and dispatching #24

Merged
merged 1 commit into from
Aug 20, 2024
Merged

Conversation

amotl
Copy link
Member

@amotl amotl commented Aug 20, 2024

When computing values for UPDATE statements, consider the data type of the value. It aims to improve crate/cratedb-toolkit#19 by @hammerhead.

... when computing values for `UPDATE` statements.
@amotl amotl marked this pull request as ready for review August 20, 2024 00:26
Copy link

codecov bot commented Aug 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (23452c6) to head (23a2618).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main       crate/cratedb-toolkit#24   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           21        21           
  Lines          824       828    +4     
=========================================
+ Hits           824       828    +4     
Flag Coverage Δ
mongodb 100.00% <100.00%> (ø)
vanilla 100.00% <100.00%> (ø)
zyp 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

"recordFormat": "application/json",
"tableName": "foo",
"dynamodb": {
"ApproximateCreationDateTime": 1720742302233719,

Choose a reason for hiding this comment

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

We need a test case for the situation of a first level field being an array of objects, for instance

"testarrayobj": [{"field1":1},{"field2":"abc"}]

This cast is successful in CrateDB:

'[{"field1":1},{"field2":"abc"}]'::ARRAY(OBJECT)

Choose a reason for hiding this comment

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

Another situation is the one of a DynamoDB String Set for which CrateDB may have already got an ARRAY(TEXT) defined, but the actual payload may have a single string, for the INSERT or UPDATE to succed we need to wrap this in [ ]

Copy link
Member Author

Choose a reason for hiding this comment

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

Thank you very much. I am adding your reports to https://github.com/crate/cratedb-toolkit/issues/233#issuecomment-2298485376, in order to merge this patch.

@amotl amotl merged commit 97940c1 into main Aug 20, 2024
17 checks passed
@amotl amotl deleted the dynamodb-better branch August 20, 2024 10:11
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