S3:SelectObjectContent does not support versionId

0

S3:SelectObjectContent should behave similar to S3:GetObject, Except it does select content from file. Why it does not support VersionId ? Do we have a plan to add VersionId support. This can enable many usecases.

Mahesh
asked a month ago84 views
1 Answer
0

Hi,

Although it is not described in the documentation, according to the following AWS GitHub repository issue, you can specify the versionId as a custom query param in the request:

SelectObjectContentRequest selectRequest = new SelectObjectContentRequest()
    .withBucketName(BUCKET)
    .withKey(KEY)
    .withExpression("SELECT count(*) from S3Object s")
    .withExpressionType(ExpressionType.SQL)
    .withInputSerialization(...)
    .withOutputSerialization(...);

selectRequest.putCustomQueryParameter("versionId", "AAA");

Have you tried it?

profile picture
EXPERT
answered a month ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions