27 questions
2
votes
2
answers
165
views
What's the cost effective way to retrieve batch DDB Items by LSI sort keys?
I have a DDB table with the following structure:
CustmerID (PK)
emailId (SortKey)
orderId (LSI)
I want to get batch items using AWS DynamoDB Java SDK for the following 2 patterns:
Get Items by a PK ...
0
votes
0
answers
107
views
How to test dynamo query with QueryEnhancedRequest with Junit
I am having trouble writing JUnits for my DynamoDB query. Here is the original code:
PageIterable<AccountTableItem> pages = table.query(queryEnhancedRequest);
for(Page<AccountTableItem> ...
1
vote
1
answer
45
views
Getting a number of items from a list by pagination in Dynamodb
I have a dynamodb structure like below:
{
"PK" : "queue#1234#view",
"SK" : "board#1234",
"items" : [
"1234&...
0
votes
1
answer
602
views
DynamoDB Java SDK - QueryRequest with IN clause
The Javadoc of software.amazon.awssdk.services.dynamodb.model.QueryRequest.expressionAttributeValues() says a following query can be done:
ProductStatus IN (:avail, :back, :disc)
where the values are ...
0
votes
1
answer
1k
views
GROUP BY-Like query in DynamoDB with DynamoDbEnhancedClient
I'm trying to write a Query in DynamoDB with logic similar to a GROUP BY in SQL. Let's consider the following table with partition key simulation_id:
Simulation (Table):
simulation_id_1 - type_1 - ....
2
votes
1
answer
182
views
Referring to existing Dynamo DB in Lambda functions
I'm trying to read an existing dynamo DB in Lambda function, but resources in YAML creates a new table. If I could do that, someone please help me how? Also I need to use an existing S3 bucket
0
votes
0
answers
340
views
How to fetch all the values of one column using column name in dynamoDB table in java?
I have a dynamoDB table in my aws account. I can create client like this.
AmazonDynamoDB amazonDynamoDB =
AmazonDynamoDBClient.builder().withRegion("eu-west-1").withCredentials(...
11
votes
1
answer
4k
views
Unmarshalling DynamoDB Map<String, AttributeValue> to document-style JSON in AWS Java SDK 2.x
The answers to the question Converting DynamoDB JSON to Standard JSON with Java are obsolete in 2022.
The problem is that both of these imports no longer work:
import com.amazonaws.services.dynamodbv2....
1
vote
1
answer
1k
views
Wrapping CompletableFuture to Mono with DynamoDb
I know the java DynamoDB's SDK is considered async non blocking but my question is:
Q. Does the dynamo update still need to be on another thread with operator publishOn to be safer in a reactive ...
1
vote
1
answer
821
views
Can't convert Map<String, AttributeValue> (DynamoDB) to POJO if use annotation @Builder
I'm trying convert Map<String, AttributeValue> to POJO. I do it like that:
new DynamoDBMapper(awsConfiguration.amazonDynamoDbClient()).marshallIntoObject(MyClass.class, myMap);
@DynamoDBTable(...
0
votes
1
answer
3k
views
Using DynamoDBEnhancedAsyncClient to scan and fetch futureObject
I am trying to use v2 library to persist & retrieve data in non-blocking manner.
Put method of DynamoDBEnhancedAsyncClient returns CompletableFuture object but scan and query methods return ...
1
vote
1
answer
339
views
Upload Files To S3 from Browser and Secure AWS Creds
i am developing a small application in ASP.net MVC ,in which i am uploading file to s3 directly from browser ,below is my code , but the problem is since it is in JavaScript my Access key and Secret ...
7
votes
1
answer
14k
views
What is the difference between DynamoDBMapper and Table for DynamoDB Tables
In AWS DynamoDB, There are two options available to do the CRUD operations on the Table.
DynamoDBMapper :
com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapper;.
AmazonDynamoDB dbClient = ...
1
vote
2
answers
3k
views
Query More Than 100 DynamoDB Items that match a Partition Key using Java SDK 2?
How can more than 100 items from a dynamodb table, matching a particular partition key, be queried using aws java sdk 2?
If the number of rows that match a hash key exceeds 100 then the ...
4
votes
2
answers
5k
views
Querying a Global Secondary Index of a DynamoDB table without using the partition key
I have a DynamoDB table with partition key as userID and no sort key.
The table also has a timestamp attribute in each item. I wanted to retrieve all the items having a timestamp in the specified ...
5
votes
1
answer
3k
views
CRUD repository bean not found exception
I have an application which connects to AWS DynamoDB. I am trying to implement Redis connection using Jedis into this application.
However, just after I add this dependency -
<dependency>
...
0
votes
1
answer
1k
views
SocketTimeoutException when calling load for DynamoDBMapper
I am getting sometimes this error when calling load for DynamoDBMapper:
java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net....
0
votes
1
answer
2k
views
How to create a serial numbers autogenerated in dynamoDb using annotations
I have created a pojo class in my java spring boot app and with respective annotations for doing create/update it's working fine but when i use the autogenerated key annotation it is creating some ...
0
votes
1
answer
1k
views
How to create a boolean datatype in AWS DynamoDB Read/Write operations using DynamoDB table annotations
I have created a class pojo class in java to create/update items in aws dynamodb when i was trying to create/update an item in dynamodb it is working fine but the column created in dynamodb datatype ...
2
votes
1
answer
9k
views
How to pass aws dynamodb table name dynamically using @DynamoDbTable annotation
I have created a java service to get the details from dynamodb it is working fine but my challenge is i hardcoded the table name to the class file @DynamoDbTable annotation in order to work with ...
2
votes
0
answers
1k
views
Rollback all transactions if one transaction throws error in dynamoDB
I'm new to dynamoDB and currently trying to develop a module which writes into the dynamoDB database using transactWrite.
Transactions are only allowed for a batch of 25 items but I want to add 500 ...
1
vote
1
answer
2k
views
AWS DynamoDB Partition Key Lock Implementation in Java
I am running same application with two different ports in my local. The code I have provided is only for testing. Here access_key and secret_key will be provided from environment variables in later ...
2
votes
0
answers
315
views
Overriding default SdkClientOption.SCHEDULED_EXECUTOR_SERVICE in AWS SDK for Java 2
Is there a way I can override the default SdkClientOption.SCHEDULED_EXECUTOR_SERVICE in AWS SDK for Java 2? I want to get rid of all the threadpools that are opaque to the application, and ensure that ...
1
vote
2
answers
2k
views
java.io.FileNotFoundException (Read-only file system) // Uploading files to S3
I am trying to create csv files from a list of maps and uploading them to S3 bucket through a lambda function. Following is the code:
public void createCSV(List<Map<String, AttributeValue>&...
2
votes
1
answer
2k
views
Push data from Dynamo DB to elasticsearch using java
Hi i have created a handler in java for getting the events from dynamo DB
Here is my code
package com.Lambda.dynamodb;
import com.amazonaws.services.lambda.runtime.Context;
import com.amazonaws....
1
vote
1
answer
1k
views
Is there a way to fetch the DynamoDB attribute name if we know the attribute name of the entity class?
Given a DynamoDB entity like this
@Data()
@DynamoDBTable(tableName = "DynamoTable")
public class DynamoTable implements Serializable {
@DynamoDBAttribute(attributeName = "DATA_VALUE")
private ...
4
votes
1
answer
2k
views
Numeric limit & offset based pagination in DynamoDB (Java)
I want to implement numeric limit and offset based pagination in DynamoDB similar to Postgres.
My API look something like this: http://foo.bar/user?offset=50&limit=20.
What's the best way to do ...