-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
list_append does not accept FunctionOperand #2994
Comments
@vitaliysapounov makes sense. Thank you for reporting. Just a heads-up, the focus of the team is in Java SDK 2.x features, so this has a low chance to be implemented in 1.x. |
@debora-ito Thanks for answering! If I provide a pull request, will it be of any help? |
A little, but not significantly, unfortunately. We appreciate your interest in writing the PR. |
Describe the bug
We tried to append an element to a List attribute in DynamoDB by executing an update like (https://stackoverflow.com/a/35001736):
SET my_list2 = list_append(if_not_exists(my_list2, :empty_list), :my_value)
Note that
if_not_exists()
is needed, as if the attribute does not yet exist, simplylist_append(my_list2, :my_value)
produces an error "The provided expression refers to an attribute that does not exist in the item".However, in
ExpressionSpecBuilder.java
the following method defined:Note that the first operand requires a path (String), but in our case we need to pass
FunctionOperand
(thatExpressionSpecBuilder.if_not_exists()
returns). Another method needs to be introduced with a signature like:or even just
Expected Behavior
ExpressionSpecBuilder.list_append()
accepts FunctionOperand (or just Operand) as the first argumentCurrent Behavior
ExpressionSpecBuilder.list_append()
accepts String (attribute path) only as the first argumentReproduction Steps
The above class does not compile.
Possible Solution
No response
Additional Information/Context
No response
AWS Java SDK version used
1.12.221
JDK version used
openjdk version "11.0.16" 2022-07-19 LTS OpenJDK Runtime Environment Corretto-11.0.16.8.1 (build 11.0.16+8-LTS) OpenJDK 64-Bit Server VM Corretto-11.0.16.8.1 (build 11.0.16+8-LTS, mixed mode)
Operating System and version
buntu 22.04.2 LTS
The text was updated successfully, but these errors were encountered: