-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🎉 Destination S3: parquet output (#3908)
* Add skeleton code for parquet writer * Refactor s3 destination code * Add parquet to spec * Complete parquet writer * Change testing data from int to double * Add acceptance test for parquet writer * Handle special schema field names * Format code * Add parquet config * Add documentation * Add unit tests * Fix typo * Update document * Bump version * Fix date format * Fix credential filename * Update doc * Update test and publish commands * Refactor s3 format config * Append compression codec file extension * Update doc * Remove compression codec file extension * Add comments * Add README, CHANGELOG, and sample configs * Move changelog * Use switch statement * Move filename helper method to base writer * Rename converter * Separate test cases * Drop union type length restriction * Support array with multiple types * Move comments to connector doc * Share config between acceptance tests * Add doc about additional properties * Move shared code out of if branch * Add doc about adding a new format * Format code * Bump version to 0.1.4 * Fix default max padding size
- Loading branch information
Showing
41 changed files
with
2,385 additions
and
436 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# S3 Test Configuration | ||
|
||
In order to test the D3 destination, you need an AWS account (or alternative S3 account). | ||
|
||
## Community Contributor | ||
|
||
As a community contributor, you will need access to AWS to run the integration tests. | ||
|
||
- Create an S3 bucket for testing. | ||
- Get your `access_key_id` and `secret_access_key` that can read and write to the above bucket. | ||
- Paste the bucket and key information into the config files under [`./sample_secrets`](./sample_secrets). | ||
- Rename the directory from `sample_secrets` to `secrets`. | ||
- Feel free to modify the config files with different settings in the acceptance test file (e.g. `S3CsvDestinationAcceptanceTest.java`, method `getFormatConfig`), as long as they follow the schema defined in [spec.json](src/main/resources/spec.json). | ||
|
||
## Airbyte Employee | ||
|
||
- Access the `destination s3 * creds` secrets on Last Pass. The `*` here represents the different file format. | ||
- Replace the `config.json` under `sample_secrets`. | ||
- Rename the directory from `sample_secrets` to `secrets`. | ||
|
||
## Add New Output Format | ||
- Add a new enum in `S3Format`. | ||
- Modify `spec.json` to specify the configuration of this new format. | ||
- Update `S3FormatConfigs` to be able to construct a config for this new format. | ||
- Create a new package under `io.airbyte.integrations.destination.s3`. | ||
- Implement a new `S3Writer`. The implementation can extend `BaseS3Writer`. | ||
- Write an acceptance test for the new output format. The test can extend `S3DestinationAcceptanceTest`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
airbyte-integrations/connectors/destination-s3/sample_secrets/config.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"s3_bucket_name": "paste-bucket-name-here", | ||
"s3_bucket_path": "integration-test", | ||
"s3_bucket_region": "paste-bucket-region-here", | ||
"access_key_id": "paste-access-key-id-here", | ||
"secret_access_key": "paste-secret-access-key-here" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
...stination-s3/src/main/java/io/airbyte/integrations/destination/s3/csv/S3CsvConstants.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* MIT License | ||
* | ||
* Copyright (c) 2020 Airbyte | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in all | ||
* copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
* SOFTWARE. | ||
*/ | ||
|
||
package io.airbyte.integrations.destination.s3.csv; | ||
|
||
public class S3CsvConstants { | ||
|
||
// These parameters are used by {@link StreamTransferManager}. | ||
// See this doc about how they affect memory usage: | ||
// https://alexmojaki.github.io/s3-stream-upload/javadoc/apidocs/alex/mojaki/s3upload/StreamTransferManager.html | ||
// Total memory = (numUploadThreads + queueCapacity) * partSize + numStreams * (partSize + 6MB) | ||
// = 31 MB at current configurations | ||
public static final int DEFAULT_UPLOAD_THREADS = 2; | ||
public static final int DEFAULT_QUEUE_CAPACITY = 2; | ||
public static final int DEFAULT_PART_SIZE_MB = 5; | ||
public static final int DEFAULT_NUM_STREAMS = 1; | ||
|
||
} |
Oops, something went wrong.