🎉 Destination Redshift (copy): accept bucket path for staging data - #8607
Conversation
7a9e31c to
1ce7b90
Compare
322ce7c to
22e2bd7
Compare
|
Sherif A. Nada (@sherifnada) do we ever do minor version bumps on connectors? I want to have destination-s3 go from 0.1.16 to 0.2.0 to reflect the change in filename convention; is that reasonable or is this still considered just a patch-level change? i.e. this changelog entry fed6c36#diff-69de65b90934b0e7e8f813cfa8298d11e6cc1104e9f64e3a010eee0441b81db9R226 |
Sherif A. Nada (sherifnada)
left a comment
There was a problem hiding this comment.
Edward Gao (@edgao) doing a minor version bump is totally fine. Once we push connectors to GA we'll also start doing honest-to-god semver.
| * @return The path within the bucket that this writer will create. For example, if we wrote to "s3://yourBucket/some/path/to/file.csv", this method | ||
| * would return "some/path/to/file.csv". | ||
| */ | ||
| String getObjectPath(); |
There was a problem hiding this comment.
would getOutputPath be accurate?
| outputStreams.get(0).toString(StandardCharsets.UTF_8)); | ||
| } | ||
|
|
||
| private static void checkObjectName(final String objectName) { |
There was a problem hiding this comment.
feels like we really just want to test the name generator, and that the name generator is being used. this is fine for now IMO, may be worth leaving this context you provided as a comment and saying output path generator should be probably be DI'd and we can just test the generator itself? in any case this is fine
Co-authored-by: Sherif A. Nada <snadalive@gmail.com>
Co-authored-by: Sherif A. Nada <snadalive@gmail.com>
|
/test connector=connectors/destination-snowflake
|
|
/publish connector=connectors/destination-redshift
|
|
/publish connector=connectors/destination-s3
|
|
/publish connector=connectors/destination-redshift
|
What
Create a new S3StreamCopier that utilizes the same code as destination-s3, rather than rolling its own S3 upload logic. Addresses #8550
Also, incidentally allows users to specify the bucket path to store staging data in.
How
@DeprecatethemMisc. notes:
s3://bucket/randomUuid/schema/stream-12345, where12345is the number of the file (i.e. starts at00000and increments for each file). Note that there was no.csvextension at all.s3://bucket/bucketPath/namespace/stream/timestamp_randomUuid.csv.bucketPathoption.timestampis set to when theRedshiftStreamCopieris instantiated. I'm pretty sure this is basically the time at which theAirbyteMessageConsumeris created, i.e. pretty close to the start of the upload. But technically NOT the same.S3Writer#getObjectKeyis unimplemented in most classes, because I didn't want to dig into all of their behaviors.mockito:mockito-inlinedependencies are needed for the mocked constructors.Recommended reading order
S3CsvWriter.java+ test +StagingDatabaseCsvSheetGenerator.java+BaseS3WriterS3StreamCopier.java+ test + factoryLegacyS3StreamCopierTest.java- mostly there to demonstrate identical behavior withS3StreamCopierTest.javaRedshiftStreamCopier.java+ test + factoryspec.json(adding parsing for this new option happened in https://github.com/airbytehq/airbyte/pull/8562/files#diff-234d0545ef4c8a9abd756f519d85f20cefa71acacdb93a9a8f4ce2a6f88482f3R74-R77 )S3DestinationConfig,S3CsvFormatConfigbuild.gradle(new mockito-inline dep), the variousXyzWriter.java(autoformatting + stubgetObjectKeyimplementation)This commit (1b4f41f#diff-5a76fbf0219c39138b2a18b074b17dde604966094df637542b142b08cd4358b9) could be interesting; it's the diff between the legacy and new behavior.
🚨 User Impact 🚨
None. The temporary files will be named differently, but they will still be created+deleted the same way.
They will be in a different directory. Hopefully nobody was allowlisting a service account to only have permission to write into
s3://bucket/anyValidUuid/*.Pre-merge Checklist
Updating a connector
Community member or Airbyter
airbyte_secret./gradlew :airbyte-integrations:connectors:<name>:integrationTest.README.mdbootstrap.md. See description and examplesdocs/integrations/<source or destination>/<name>.mdincluding changelog. See changelog exampleAirbyter
If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.
/test connector=connectors/<name>command is passing./publishcommand described here