From b3f19ada0b6dccb543f6a781f04c5820205dbeb5 Mon Sep 17 00:00:00 2001 From: Gloria Doci Date: Mon, 30 Oct 2023 10:55:22 +0000 Subject: [PATCH] allow only GZIP as compression algorithm --- src/main/java/net/snowflake/ingest/utils/Constants.java | 9 ++------- .../ingest/streaming/internal/ParameterProviderTest.java | 4 ++-- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/main/java/net/snowflake/ingest/utils/Constants.java b/src/main/java/net/snowflake/ingest/utils/Constants.java index 3fc99f147..a22bc9f21 100644 --- a/src/main/java/net/snowflake/ingest/utils/Constants.java +++ b/src/main/java/net/snowflake/ingest/utils/Constants.java @@ -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) { diff --git a/src/test/java/net/snowflake/ingest/streaming/internal/ParameterProviderTest.java b/src/test/java/net/snowflake/ingest/streaming/internal/ParameterProviderTest.java index 256b5222f..f185fdcef 100644 --- a/src/test/java/net/snowflake/ingest/streaming/internal/ParameterProviderTest.java +++ b/src/test/java/net/snowflake/ingest/streaming/internal/ParameterProviderTest.java @@ -21,7 +21,7 @@ private Map 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; } @@ -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()); }