Skip to content

Issue 7459: Hadoop can't create S3 client with latest AWS SDK - #7520

Closed
rtjd6554 wants to merge 66 commits into
developfrom
7459-Hadoop-S3-Client
Closed

Issue 7459: Hadoop can't create S3 client with latest AWS SDK#7520
rtjd6554 wants to merge 66 commits into
developfrom
7459-Hadoop-S3-Client

Conversation

@rtjd6554

@rtjd6554 rtjd6554 commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

Make sure you have checked all steps below.

Issue

  • My PR fully resolves the following issues. I've referenced an issue in the PR title, for example "Issue 1234 - My
    Feature". Note that before an issue is finished, you can still make a pull request by raising a separate issue
    for your progress.

Tests

  • My PR adds the following tests based on our test strategy OR does not need testing for this extremely good reason:
    • Execution of existing test suite, primary focus has been around the integration tests that utilise s3client within it.
      E.g. DockerInstanceIT, TpchSchemaPartitionedInsertPartitioningEnabledIT or DataFusionCompactionRunnerLocalStackIT

Documentation

  • In case of new functionality, my PR adds documentation that describes how to use it, or I have linked to a
    separate issue for that below.
  • If I have added new Java code, I have added Javadoc that explains it following our conventions and style.
  • If I have added or removed any dependencies from the project, I have updated the NOTICES file.

@rtjd6554 rtjd6554 added the needs-reviewer Pull requests that need a reviewer to be assigned label Jul 1, 2026
@rtjd6554
rtjd6554 marked this pull request as ready for review July 1, 2026 12:01
@ca61688 ca61688 self-assigned this Jul 2, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a lot of code added here, I know the ticket says the existing test covers everything for this ticket but are there any unit tests that could be added for this class?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a lot of coverage of this already. It's used in all the integration tests for code that uses Hadoop, although that's just against LocalStack.

I think if we run the full performance test suite against this branch before merging that's probably enough?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the PR description needs updating to clarify which tests have been run or need to be run.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we do need to run the performance test suite against this branch before we can merge it, because we don't know how this affects performance, or if it's working for Spark in a deployed instance.

@patchwork01 patchwork01 Jul 17, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thinking about it, the behaviour of applying the Hadoop configuration properties would be good to have unit tests for. Can we do that?

If I could see a direct one-to-one correspondence with the Hadoop equivalent of this class I'd be less worried. As it is, the diff between this and the Hadoop version isn't easily comparable.

Would you prefer to unit test the behaviour or make it a more direct copy of the Hadoop code?

Here's a link to the original thread if you're reading this in the review: #7520 (comment)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unit tests added

@ca61688

ca61688 commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

Overall looks good, one comment about if we can add more tests

@ca61688 ca61688 removed their assignment Jul 2, 2026
@patchwork01 patchwork01 removed the needs-reviewer Pull requests that need a reviewer to be assigned label Jul 20, 2026
@rtjd6554 rtjd6554 removed their assignment Jul 31, 2026
@rtjd6554 rtjd6554 added the needs-reviewer Pull requests that need a reviewer to be assigned label Jul 31, 2026

@patchwork01 patchwork01 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the AWS SDK release notes it states that the change was to remove the apache-client dependency by default. That contains the HTTP client used by Hadoop, and it still exists:

https://github.com/aws/aws-sdk-java-v2/releases/tag/2.46.0

I think it would be much safer and easier to add that back in, rather than carry on in the current direction. The original idea was to replace a minimum of the Hadoop code with something that will do the same thing. If that's not necessary I think we're better off not doing it anyway, and this is taking too long to match Hadoop.

I think it looks like all we need is the apache-client dependency in the parquet module.

It might be best to make a fresh branch for that and leave this here in case we want to pick it back up?


@Override
public S3Client createS3Client(URI uri, S3ClientCreationParameters params) throws IOException {
return configureClientBuilder(S3Client.builder(), params, getConf(), uri.getHost())

@patchwork01 patchwork01 Jul 31, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't look like this has been addressed. Here's a link to the original comment: #7520 (comment)

}

@Test
void shouldApplyRequestTimeoutFromConfiguration() throws Exception {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment doesn't explain the correspondence to the Hadoop code I mentioned. It's testing that AWSClientConfig.createClientConfigBuilder is used.

@@ -47,10 +47,21 @@
<artifactId>hadoop-aws</artifactId>
</dependency>
<!-- We exclude the AWS SDK as a dependency of hadoop-aws because it uses the bundle, so add just S3 back in. -->

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment needs updating. Most of it is still correct but we're not just adding S3 back in any more.

clientOverrideConfigBuilder.addMetricPublisher(
new AwsStatisticsCollector(parameters.getMetrics()));
}

@patchwork01 patchwork01 Jul 31, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's not what the Hadoop implementation does. Is there a reason to make this different? Here's a link to the original thread: #7520 (comment)

configureEndpointAndRegion(builder, parameters, conf);

S3Configuration serviceConfiguration = S3Configuration.builder()
.pathStyleAccessEnabled(parameters.isPathStyleAccess())

@patchwork01 patchwork01 Jul 31, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't look like this has been done. Here's a link to the original thread: #7520 (comment)


private static final String REQUESTER_PAYS_HEADER_VALUE = "requester";

private static Region defaultRegion = Region.US_EAST_2;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be final.

@patchwork01

Copy link
Copy Markdown
Collaborator

Please see my comment at the start of the review rather than the individual review comments. Those are there in case we still need to replace the Hadoop implementation.

@patchwork01 patchwork01 removed the needs-reviewer Pull requests that need a reviewer to be assigned label Jul 31, 2026
@patchwork01

Copy link
Copy Markdown
Collaborator

Closing as this has been resolved by the following PR:

@patchwork01 patchwork01 closed this Aug 3, 2026
@patchwork01
patchwork01 deleted the 7459-Hadoop-S3-Client branch August 3, 2026 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hadoop can't create S3 client with latest AWS SDK

3 participants