Skip to content

GH-50148: [C++] Add Content-Encoding support to S3 filesystem metadata - #50167

Merged
kou merged 2 commits into
apache:mainfrom
alytantawyy:fix-s3-content-encoding
Oct 1, 2026
Merged

kou merged 2 commits into
apache:mainfrom
alytantawyy:fix-s3-content-encoding

Conversation

@alytantawyy

@alytantawyy alytantawyy commented Jun 12, 2026 •

Copy link
Copy Markdown
Contributor

Rationale for this change

The S3 filesystem metadata handling supported headers such as Content-Type,
Content-Language, Cache-Control, and Expires, but omitted
Content-Encoding.

As a result, Content-Encoding was not propagated when writing S3 object
metadata, and it was also not returned when reading metadata back.

What changes are included in this PR?

  • add Content-Encoding to S3 object metadata extraction
  • add Content-Encoding to the S3 metadata setter whitelist
  • reuse the existing string metadata setter for Content-Encoding
  • extend the S3 metadata round-trip test to cover explicit and default
    Content-Encoding metadata

Are these changes tested?

Yes.

./cpp/build-s3-system/debug/arrow-s3fs-test --gtest_filter=TestS3FS.OpenOutputStreamMetadata

@pitrou

pitrou commented Jun 25, 2026

Copy link
Copy Markdown
Member

@raulcd @kou I have no idea why the CUDA Python jobs have run here, as I only see non-CUDA C++ changes?

@raulcd

raulcd commented Jun 25, 2026

Copy link
Copy Markdown
Member

I have no idea why the CUDA Python jobs have run here, as I only see non-CUDA C++ changes?

This is weird, all extra jobs are running not only CUDA but R Extra, Packaging Extra, C++ Extra and it does not seem like any of the required labels were ever present.

@raulcd

raulcd commented Jun 25, 2026

Copy link
Copy Markdown
Member

ok, the PR seems to be quite outdated with respect to main so the git diff when checking labels seems to show lots of files changed and forces the jobs to run as some of those files trigger the them, see: https://github.com/apache/arrow/actions/runs/27442216149/job/83430959300?pr=50167#step:3:39

@pitrou

pitrou commented Jul 8, 2026

Copy link
Copy Markdown
Member

@alytantawyy Can you please first rebase or merge from git main as it seems this PR is based on a quite outdated snapshot of the source tree?

@alytantawyy
alytantawyy force-pushed the fix-s3-content-encoding branch from 25b01e0 to 4ddbbdb Compare September 6, 2026 00:29
@alytantawyy

Copy link
Copy Markdown
Contributor Author

@pitrou @raulcd @kou Rebased onto the latest main. The targeted S3 metadata test passes locally.

@kou

kou commented Sep 6, 2026

Copy link
Copy Markdown
Member

Could you fix the lint failure?

Comment thread cpp/src/arrow/filesystem/s3fs.cc Outdated
static std::unordered_map<std::string, Setter> GetSetters() {
return {{"ACL", CannedACLSetter()},
{"Cache-Control", StringSetter(&ObjectRequest::SetCacheControl)},
{"Content-Encoding", ContentEncodingSetter()},

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can we use StringSetter(&ObjectRequest::SetContentEncoding)?

Suggested change
{"Content-Encoding", ContentEncodingSetter()},
{"Content-Encoding", StringSetter(&ObjectRequest::SetContentEncoding)},

@alytantawyy alytantawyy Sep 29, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated to use StringSetter(&ObjectRequest::SetContentEncoding) and fixed the clang-format failure. The targeted S3 metadata test passes locally. @kou @raulcd

@github-actions github-actions Bot added awaiting changes Awaiting changes and removed awaiting review Awaiting review labels Sep 7, 2026
@github-actions github-actions Bot added awaiting change review Awaiting change review and removed awaiting changes Awaiting changes labels Sep 29, 2026
@alytantawyy

Copy link
Copy Markdown
Contributor Author

@kou @raulcd following up

@kou kou left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

+1

@kou
kou merged commit f36c238 into apache:main Oct 1, 2026
57 of 61 checks passed
@kou kou removed the awaiting change review Awaiting change review label Oct 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants