Skip to content
This repository has been archived by the owner on Jun 13, 2023. It is now read-only.

how do I paginate through dynamodb scan operation #4

Closed
CruncherBigData opened this issue Dec 28, 2013 · 5 comments
Closed

how do I paginate through dynamodb scan operation #4

CruncherBigData opened this issue Dec 28, 2013 · 5 comments
Assignees

Comments

@CruncherBigData
Copy link

I have a table that has more than 1000 rows. and I need to paginate through the result of the scan operation, in the JAVA SDK I used getLastEvaluatedKey() and then start with that for my next iteration , is there something similar in this awsscala ?

for example,

val googlers: Seq[Item] = table.scan(Seq("Company" -> Condition.gt("Google"))) // will filter against the 1st 1000 rows only.

thanks in advance

@seratch
Copy link
Owner

seratch commented Dec 28, 2013

AWScala supports some options like this:

https://github.com/seratch/AWScala/blob/0.1.0/src/main/scala/awscala/dynamodbv2/DynamoDB.scala#L251-L253

Is it not enough?

@ghost ghost assigned seratch Dec 28, 2013
@CruncherBigData
Copy link
Author

got it , I changed my code to use scala dynamoDB.scan instead of scala table.scan and that solved it. thanks @seratch

@seratch
Copy link
Owner

seratch commented Dec 29, 2013

Ah, I got it. I've enabled specifying pagination params in table.scan(...) too. Try version 0.1.1.

@CruncherBigData
Copy link
Author

something like this ?
sbt libraryDependencies += "com.github.seratch" %% "awscala" % "[0.1.1,)"

@seratch
Copy link
Owner

seratch commented Dec 29, 2013

Basically retaining "[0.1,)" works fine. If it doesn't work for you, specify "0.1.1" like this:

libraryDependencies += "com.github.seratch" %% "awscala" % "0.1.1"

CruncherBigData pushed a commit to CruncherBigData/AWScala that referenced this issue Jan 28, 2014
seratch pushed a commit that referenced this issue Jan 25, 2021
* Update scalatest to 3.0.9

* disable release on push branches

* disable release on push branches, added build.yml

* Update scalatest to 3.0.9

* update .gitignore

Co-authored-by: Scala Steward <scala-steward@users.noreply.github.com>
Co-authored-by: Rodolfo Echemendía Quintana <rechemendia@travelonux.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants