Skip to content

Commit

Permalink
allow only GZIP as compression algorithm
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-gdoci committed Oct 30, 2023
1 parent 333bc07 commit b3f19ad
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
9 changes: 2 additions & 7 deletions src/main/java/net/snowflake/ingest/utils/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -119,15 +119,10 @@ public static BdecVersion fromInt(int val) {
* CompressionCodecName, but we want to control and allow only specific values of that.
*/
public enum BdecParquetCompression {
UNCOMPRESSED,
GZIP,
SNAPPY,
ZSTD;
GZIP;

public CompressionCodecName getCompressionCodec() {
return (this == UNCOMPRESSED
? CompressionCodecName.fromConf(null)
: CompressionCodecName.fromConf(this.name()));
return CompressionCodecName.fromConf(this.name());
}

public static BdecParquetCompression fromName(String name) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ private Map<String, Object> getStartingParameterMap() {
parameterMap.put(ParameterProvider.BLOB_UPLOAD_MAX_RETRY_COUNT, 100);
parameterMap.put(ParameterProvider.MAX_MEMORY_LIMIT_IN_BYTES, 1000L);
parameterMap.put(ParameterProvider.MAX_CHANNEL_SIZE_IN_BYTES, 1000000L);
parameterMap.put(ParameterProvider.BDEC_PARQUET_COMPRESSION_ALGORITHM, "zstd");
parameterMap.put(ParameterProvider.BDEC_PARQUET_COMPRESSION_ALGORITHM, "gzip");
return parameterMap;
}

Expand All @@ -42,7 +42,7 @@ public void withValuesSet() {
Assert.assertEquals(1000L, parameterProvider.getMaxMemoryLimitInBytes());
Assert.assertEquals(1000000L, parameterProvider.getMaxChannelSizeInBytes());
Assert.assertEquals(
Constants.BdecParquetCompression.ZSTD,
Constants.BdecParquetCompression.GZIP,
parameterProvider.getBdecParquetCompressionAlgorithm());
}

Expand Down

0 comments on commit b3f19ad

Please sign in to comment.