Skip to content

PR/DynamoDB operations and parsers#1521

Open
aschenzle wants to merge 10 commits into
masterfrom
pr/dynamodb-operations-and-parsers
Open

PR/DynamoDB operations and parsers#1521
aschenzle wants to merge 10 commits into
masterfrom
pr/dynamodb-operations-and-parsers

Conversation

@aschenzle
Copy link
Copy Markdown
Collaborator

Introduces DynamoDB operations and parsers. The design differ a little bit from Mongo and other DBs as DynamoDB has complex expression that need to be parsed in order of precedence. There are top level parsers instead of simple selectors and the logic is split per Dynamo API call and some helper classes. To avoid writing a full blown parser I'm using Antlr as a runtime dependency in controller, I shaded the dependency but please let me know if this could bring any problems or if I'm missing something.

Some random comments: 1) Netty dependency is no longer explicitly needed in controller as now AWSSDK is bringing it. 2) There's a fix for hibernate-validator dependency which is unrelated but eliminates some warnings. 3) Added SimpleLogger to controller tests, eliminates a warning when running tests and actually logs (for example I could see the whole Docker log which wasn't visible before), this will probably increase the warning count when running tests, this is just surfacing them.

@aschenzle aschenzle requested a review from jgaleotti April 24, 2026 06:13
@jgaleotti
Copy link
Copy Markdown
Collaborator

Why don't you dump the dynamoDB query into a string and then parse it back from it?

… to verify BETWEEN works with byte bounds (also ran an integration test but it's beyond the scope of this commit and will add as part of end 2 end tests later. Renamed all "Object request" to ddbRequest to make it easier to read. Improved Javadoc all around.
@aschenzle
Copy link
Copy Markdown
Collaborator Author

Why don't you dump the dynamoDB query into a string and then parse it back from it?

Check latest commit with comments added.

@aschenzle aschenzle closed this Apr 29, 2026
@aschenzle aschenzle reopened this Apr 29, 2026
@jgaleotti
Copy link
Copy Markdown
Collaborator

Please remember to re-ask for a review. Otherwise it might miss to review your changes.

@jgaleotti jgaleotti requested a review from arcuri82 April 30, 2026 17:55
@arcuri82
Copy link
Copy Markdown
Collaborator

arcuri82 commented May 6, 2026

@jgaleotti @aschenzle sorry, due to exams and sickness, don't think i ll have any time to look at this till next week

public Map<String, QueryOperation> parseRequest(Object ddbRequest) {
Object requestItemsObj = invokeNoArg(ddbRequest, METHOD_REQUEST_ITEMS);
if (!(requestItemsObj instanceof Map<?, ?>)) {
return Collections.emptyMap();
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

are there cases in which this is a normal behavior?
or should rather throw an exception? or issue a warning?
i mean, what are the cases in which METHOD_REQUEST_ITEMS does not return a map?
or should explicitly as well check for null?

Copy link
Copy Markdown
Collaborator Author

@aschenzle aschenzle May 12, 2026

Choose a reason for hiding this comment

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

Hi @arcuri82 no, it's not expected (it's either a map or null at most), the design decision here is around allowing the program to continue with less information (given that DDB is a secondary target) vs throwing and catching exceptions upstream which could potentially (if not well managed) stop the whole test generation. Let me know if you strongly prefer Exceptions instead.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

not throwing exception is fine, but silently ignoring the problem is not. you can use SimpleLogger to log this issue

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Added logging

Comment thread client-java/controller/pom.xml
Comment thread client-java/controller/pom.xml
Comment thread client-java/controller/pom.xml
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.

3 participants