You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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, simply list_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 (that ExpressionSpecBuilder.if_not_exists() returns). Another method needs to be introduced with a signature like:
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. ExpressionSpecBuilder is not supported in Java SDK 2.x, we are tracking here - aws/aws-sdk-java-v2#2995.
A little, but not significantly, unfortunately.
Java SDK 1.x mainline is in our internal systems, so we'd need to replicate the changes of the PR internally, and do the code review and perform tests. This would have low priority if compared to other tasks we need to work on.
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: