Make S3 SelectObjectContentInput ScanRange members pointers #2147
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.
Problem
TLDR: Int64 members
Start
andEnd
ofScanRange
for theSelectObjectContentInput
are omitted when serialized if they are 0.When calling SelectObjectContent, you can specify a ScanRange to only request
records between start and end positions.
For example we want to process only the records starting from the 0th byte to the 100th byte we can have a Go code like this:
Expected API call should have a ScanRange section that looks like this:
But when checked the log output, it looks like this:
Which meant, "process only the records within the last 100 bytes of the file"
according to the
docs.
So there is no way to specify the start position as 0 and end position as an arbitrary number, of the ScanRange at the current state of the SDK.
Hypothesis
The client just omits the
Start
orEnd
member of theScanRange
shape when it isequal to 0. Since it is an unboxed type and its empty value is 0 it is not serialized to the request.
Solution
Added a customization that adds
clientOptional
trait to theStart
andEnd
members of the S3
ScanRange
shape. And regenerate the client code to makethese members optional.
Since this will break any existing application that specifies
ScanRange
withStart
andEnd
fields set, an announcement is added to the changelog regarding the breaking change.