Issue 7459: Hadoop can't create S3 client with latest AWS SDK - #7520
Issue 7459: Hadoop can't create S3 client with latest AWS SDK#7520rtjd6554 wants to merge 66 commits into
Conversation
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
I think the PR description needs updating to clarify which tests have been run or need to be run.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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)
|
Overall looks good, one comment about if we can add more tests |
There was a problem hiding this comment.
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()) |
There was a problem hiding this comment.
It doesn't look like this has been addressed. Here's a link to the original comment: #7520 (comment)
| } | ||
|
|
||
| @Test | ||
| void shouldApplyRequestTimeoutFromConfiguration() throws Exception { |
There was a problem hiding this comment.
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. --> | |||
There was a problem hiding this comment.
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())); | ||
| } | ||
|
|
There was a problem hiding this comment.
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()) |
There was a problem hiding this comment.
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; |
|
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. |
|
Closing as this has been resolved by the following PR: |
Make sure you have checked all steps below.
Issue
Feature". Note that before an issue is finished, you can still make a pull request by raising a separate issue
for your progress.
Tests
E.g. DockerInstanceIT, TpchSchemaPartitionedInsertPartitioningEnabledIT or DataFusionCompactionRunnerLocalStackIT
Documentation
separate issue for that below.