-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🎉 Destination s3 / gcs: add option for uncompressed csv and jsonl for…
…mat (#12167) * Add gzip compression option * Add file extension method to s3 format config * Pass gzip compression to serialized buffer * Add unit test * Format code * Update integration test * Bump version and update doc * Fix unit test * Add extra gzip tests for csv and jsonl * Make compression an oneOf param * Migrate csv config to new compression spec * Migrate jsonl config to new compression spec * Update docs * Fix unit test * Fix integration tests * Format code * Bump version * auto-bump connector version * Bump gcs version in seed Co-authored-by: Octavia Squidington III <octavia-squidington-iii@users.noreply.github.com>
- Loading branch information
Showing
37 changed files
with
658 additions
and
91 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
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
32 changes: 32 additions & 0 deletions
32
...ion/java/io/airbyte/integrations/destination/gcs/GcsCsvGzipDestinationAcceptanceTest.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,32 @@ | ||
/* | ||
* Copyright (c) 2021 Airbyte, Inc., all rights reserved. | ||
*/ | ||
|
||
package io.airbyte.integrations.destination.gcs; | ||
|
||
import com.amazonaws.services.s3.model.S3Object; | ||
import com.fasterxml.jackson.databind.JsonNode; | ||
import io.airbyte.commons.json.Jsons; | ||
import io.airbyte.integrations.destination.s3.csv.S3CsvFormatConfig.Flattening; | ||
import java.io.IOException; | ||
import java.io.InputStreamReader; | ||
import java.io.Reader; | ||
import java.nio.charset.StandardCharsets; | ||
import java.util.Map; | ||
import java.util.zip.GZIPInputStream; | ||
|
||
public class GcsCsvGzipDestinationAcceptanceTest extends GcsCsvDestinationAcceptanceTest { | ||
|
||
@Override | ||
protected JsonNode getFormatConfig() { | ||
// config without compression defaults to GZIP | ||
return Jsons.jsonNode(Map.of( | ||
"format_type", outputFormat, | ||
"flattening", Flattening.ROOT_LEVEL.getValue())); | ||
} | ||
|
||
protected Reader getReader(final S3Object s3Object) throws IOException { | ||
return new InputStreamReader(new GZIPInputStream(s3Object.getObjectContent()), StandardCharsets.UTF_8); | ||
} | ||
|
||
} |
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
Oops, something went wrong.