Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Changes for findOne command #27
Changes for findOne command #27
Changes from 3 commits
22613f1
9891589
c7ae5c3
6065425
33aa538
2ec110c
b91ac84
7aa86b7
5a6baa5
d38145d
5669847
a490e1a
8a42f3d
d90184e
4092d7d
fa42501
c8cd641
2c3ca82
0e1af4d
3eb3db7
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how's
maxLimit()
different frommaxPageSize()
? If we are storing document per row, why do we need this limit?This was different in previous versions of docs api, as we stored documents in multiple rows, thus we need to defined limis for documents getting back and limits for page size in the executed queries.. I don't see this situation here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maxPageSize is for maximum number of record that can be fetched in a query iteration, which can be paginated. maxLimit is maximum number of documents that can be delivered for a command. If a find command (yet to be implemented) reads all the document in a collection, even if it's paginated it will return only max document set as limit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah so this is because of the possible in memory filtering right? 👍
But default of
1000
seems wrong,20
is the default "page" size in many implementationsThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not in that context. Let say if a query is "select * from table", maxLimit defines how many records we will return irrespective of pagination. If maxLimit is 1000 the query will be run as "select * from table limit 1000" if limit value cannot be resolved from the command.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aha, ok, but shouldn't limit always be same as page size? 😕
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It need not be. If for example the user want to show any 200 document on the screen (may be sorted). The limit will be 200. To keep the VM in check in stargate we will have max page size as 100. The driver will paginate and return 200 records.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this means if parsing any of the rows fails, this ends up in the exception. Is this the wanted behavior?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
objectMapper.readTree is throwing JsonProcessingException which needs to be handled but in theory this will never happen because the json document stored is validated during insert.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we want something similar as we have in the docs v3 ->
io.stargate.sgv2.docsapi.service.common.model.RowWrapper
Imo this is a very nice utility that helps you row columns by name.. I see you used ids here, is this what we want to do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are only max of 3 static columns read from the table as per design. I don't think we need them.