From 93fda44edf336fea8a79dc0d5b131083e2292839 Mon Sep 17 00:00:00 2001 From: Jason Zhang Date: Fri, 29 Mar 2024 14:13:13 +0800 Subject: [PATCH] [format] Set orc.compression.zstd.level to 3 by default (#3114) --- docs/layouts/shortcodes/generated/orc_configuration.html | 2 +- paimon-format/src/main/java/org/apache/orc/OrcConf.java | 2 +- .../java/org/apache/paimon/format/orc/writer/OrcZstdTest.java | 4 +--- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/docs/layouts/shortcodes/generated/orc_configuration.html b/docs/layouts/shortcodes/generated/orc_configuration.html index 92b1a9106754..ffdae855e2fa 100644 --- a/docs/layouts/shortcodes/generated/orc_configuration.html +++ b/docs/layouts/shortcodes/generated/orc_configuration.html @@ -40,7 +40,7 @@
orc.compression.zstd.level
- 1 + 3 Integer Define the compression level to use with ZStandard codec while writing data. The valid range is 1~22. diff --git a/paimon-format/src/main/java/org/apache/orc/OrcConf.java b/paimon-format/src/main/java/org/apache/orc/OrcConf.java index 6aa357868f17..a7fa1a21bc8c 100644 --- a/paimon-format/src/main/java/org/apache/orc/OrcConf.java +++ b/paimon-format/src/main/java/org/apache/orc/OrcConf.java @@ -114,7 +114,7 @@ public enum OrcConf { COMPRESSION_ZSTD_LEVEL( "orc.compression.zstd.level", "hive.exec.orc.compression.zstd.level", - 1, + 3, "Define the compression level to use with ZStandard codec " + "while writing data. The valid range is 1~22"), COMPRESSION_ZSTD_WINDOWLOG( diff --git a/paimon-format/src/test/java/org/apache/paimon/format/orc/writer/OrcZstdTest.java b/paimon-format/src/test/java/org/apache/paimon/format/orc/writer/OrcZstdTest.java index d5f8f8bc7cc7..0bf90b38a4a7 100644 --- a/paimon-format/src/test/java/org/apache/paimon/format/orc/writer/OrcZstdTest.java +++ b/paimon-format/src/test/java/org/apache/paimon/format/orc/writer/OrcZstdTest.java @@ -145,12 +145,10 @@ public void testZstdDirectDecompress() { try (ZstdCodec zstdCodec = new ZstdCodec()) { // write bytes to heap buffer. assertTrue(zstdCodec.compress(in, out, null, zstdCodec.getDefaultOptions())); - int position = out.position(); out.flip(); // copy heap buffer to direct buffer. - directOut.put(out.array()); + directOut.put(out); directOut.flip(); - directOut.limit(position); zstdCodec.decompress(directOut, directResult);