Skip to content

[copy_from]: Flush out implementation of CSV format #30956

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 27, 2025

Conversation

ParkMyCar
Copy link
Contributor

@ParkMyCar ParkMyCar commented Jan 6, 2025

This PR makes the CSV implementation for bulk imports "feature complete". It adds support for specifying things like the delimiter and escape character, as well as support for handling compressed CSV files.

Motivation

Fixes https://github.com/MaterializeInc/database-issues/issues/8902

Tips for reviewer

While the changes exist in storage-* crates, they are more general async-Rust changes and nothing necessarily specific to storage itself.

Checklist

  • This PR has adequate test coverage / QA involvement has been duly considered. (trigger-ci for additional test/nightly runs)
  • This PR has an associated up-to-date design doc, is a design doc (template), or is sufficiently small to not require a design.
  • If this PR evolves an existing $T ⇔ Proto$T mapping (possibly in a backwards-incompatible way), then it is tagged with a T-proto label.
  • If this PR will require changes to cloud orchestration or tests, there is a companion cloud PR to account for those changes that is tagged with the release-blocker label (example).
  • If this PR includes major user-facing behavior changes, I have pinged the relevant PM to schedule a changelog post.

@ParkMyCar ParkMyCar force-pushed the copy/from-s3-csv branch 2 times, most recently from fcdea0f to b7faadd Compare January 18, 2025 01:36
* plumb the CSV params through to oneshot_source::CsvFormat to handle different delimiters and what not
* add support for compressed CSVs using async_compression
    * various Bazel changes for the C dependencies from the compression algorithms
@ParkMyCar ParkMyCar changed the title [dnr][copy_from]: Complete implementation of CSV format [copy_from]: Flush out implementation of CSV format Jan 21, 2025
@ParkMyCar ParkMyCar marked this pull request as ready for review January 21, 2025 17:35
@ParkMyCar ParkMyCar requested review from a team as code owners January 21, 2025 17:35
@ParkMyCar ParkMyCar requested a review from jkosh44 January 21, 2025 17:35
Copy link
Contributor

@jkosh44 jkosh44 left a comment

Choose a reason for hiding this comment

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

Adapter bits LGTM, I'll leave sign off to storage where the bulk of the changes are.

@ParkMyCar ParkMyCar requested a review from aljoscha January 22, 2025 03:44
@ParkMyCar ParkMyCar mentioned this pull request Jan 22, 2025
5 tasks
@ParkMyCar
Copy link
Contributor Author

Hey @aljoscha, even though there are changes in the storage-operators crate, almost all of this is Adapter adjacent code. Do you want to take a look or are you okay merging with @jkosh44's approval?

Copy link
Contributor

@aljoscha aljoscha left a comment

Choose a reason for hiding this comment

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

looks good!

@ParkMyCar ParkMyCar merged commit a759ee5 into MaterializeInc:main Jan 27, 2025
79 checks passed
ParkMyCar added a commit that referenced this pull request Jan 29, 2025
_Stacked on top of_:
#30956

This PR implements a new AwsS3 `OneshotSource` that allows copying in
files from S3, e.g.
```
COPY INTO my_table FROM 's3://my-test-bucket' (FORMAT CSV, FILES = ['important.csv']);
```

Along with `FILES = [<files>]` we also support a `PATTERN = <glob>`
option which allows copying multiple files all at once.

### Motivation

Fixes https://github.com/MaterializeInc/database-issues/issues/8860
Fixes https://github.com/MaterializeInc/database-issues/issues/8855

### Tips for reviewer

Review only the final commit, the one titled "start, implementation of
an S3 oneshot source"

### Checklist

- [x] This PR has adequate test coverage / QA involvement has been duly
considered. ([trigger-ci for additional test/nightly
runs](https://trigger-ci.dev.materialize.com/))
- [x] This PR has an associated up-to-date [design
doc](https://github.com/MaterializeInc/materialize/blob/main/doc/developer/design/README.md),
is a design doc
([template](https://github.com/MaterializeInc/materialize/blob/main/doc/developer/design/00000000_template.md)),
or is sufficiently small to not require a design.
  <!-- Reference the design in the description. -->
- [x] If this PR evolves [an existing `$T ⇔ Proto$T`
mapping](https://github.com/MaterializeInc/materialize/blob/main/doc/developer/command-and-response-binary-encoding.md)
(possibly in a backwards-incompatible way), then it is tagged with a
`T-proto` label.
- [x] If this PR will require changes to cloud orchestration or tests,
there is a companion cloud PR to account for those changes that is
tagged with the release-blocker label
([example](https://github.com/MaterializeInc/cloud/pull/5021)).
<!-- Ask in #team-cloud on Slack if you need help preparing the cloud
PR. -->
- [x] If this PR includes major [user-facing behavior
changes](https://github.com/MaterializeInc/materialize/blob/main/doc/developer/guide-changes.md#what-changes-require-a-release-note),
I have pinged the relevant PM to schedule a changelog post.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants