aws-sdk-rust icon indicating copy to clipboard operation
aws-sdk-rust copied to clipboard

`SelectObjectContent` `ScanRange` does not accept zero-start

Open Licht-T opened this issue 2 years ago • 5 comments

Describe the bug

ScanRange is the zero-start range, but Rust SDK doesn't accept zero as Start value.

https://github.com/awslabs/aws-sdk-rust/blob/b06cd25e2ade91951d4ce52ced908c49ac280401/sdk/s3/src/xml_ser.rs#L1114-L1121

Expected Behavior

When the range is [0, 54], the ScanRange element of request body should be:

<ScanRange><Start>0</Start><End>54</End></ScanRange>

Current Behavior

When the range is [0, 54], it is currently:

<ScanRange><End>54</End></ScanRange>

Reproduction Steps

                    let mut select_object_content_req = client
                        .select_object_content()
                        .bucket(bucket.to_owned())
                        .key(key.to_owned())
(snip)
                        .scan_range(
                            ScanRange::builder()
                                .start(0)
                                .end(54)
                                .build(),
                        )

Possible Solution

No response

Additional Information/Context

No response

Version

v0.49.0

Environment details (OS name and version, etc.)

Ubuntu 22.04

Logs

No response

Licht-T avatar Oct 07 '22 12:10 Licht-T

@Licht-T Thanks for reporting this. I'll take a look today and see if I can fix it.

Velfi avatar Oct 07 '22 14:10 Velfi

I was able to reproduce this issue. It should be solvable by customizing the serializer to serialize zeros for that operation. Working on that now.

Velfi avatar Oct 07 '22 15:10 Velfi

I was able to fix this with a serializer codegen update. I'll update this post again once the fix is released (should be less than 2 weeks.)

Velfi avatar Oct 07 '22 16:10 Velfi

Thanks, @Velfi. Looking forward to the PR merged.

Licht-T avatar Oct 07 '22 21:10 Licht-T

It looks like this is going to take longer than I expected. I'm going to be working this week to find a better solution to this issue.

Velfi avatar Oct 17 '22 15:10 Velfi

Hey @Licht-T, I'm sorry to say that there's been no new developments. My current stance is that I should probably close the current PR and create a new fix that solves this issue with input tracking, per @jdisanti 's comment.

Velfi avatar Oct 26 '22 14:10 Velfi

Sorry again for the lack of movement on this. This week I'm going to check if a recent PR that changes how we handle values like StartRange and EndRange fixes this.

Velfi avatar Nov 16 '22 17:11 Velfi

After looking into this, I believe it's going to be blocked until we implement smithy IDL v2 support. This is due to the fact that we need to interact with the default trait which is only available in IDL v2.

Velfi avatar Nov 17 '22 19:11 Velfi

Blocked on https://github.com/awslabs/aws-sdk-rust/issues/536 and https://github.com/awslabs/smithy-rs/issues/1767

Velfi avatar Nov 28 '22 17:11 Velfi

This should be fixed when S3 adds @clientOptional to all primitives.

rcoh avatar Aug 08 '23 18:08 rcoh

This should be fixed in v0.38, we are verifying

rcoh avatar Nov 20 '23 19:11 rcoh

Confirmed this is fixed in the 1.x SDK version.

jdisanti avatar Dec 06 '23 00:12 jdisanti

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.

github-actions[bot] avatar Dec 06 '23 00:12 github-actions[bot]