diff --git a/velox/common/compression/Compression.cpp b/velox/common/compression/Compression.cpp index 734d8a5a1ec5..fc407e7be20d 100644 --- a/velox/common/compression/Compression.cpp +++ b/velox/common/compression/Compression.cpp @@ -198,8 +198,8 @@ bool Codec::isAvailable(CompressionKind kind) { } std::optional Codec::getUncompressedLength( - uint64_t inputLength, - const uint8_t* input) const { + const uint8_t* input, + uint64_t inputLength) const { return std::nullopt; } @@ -224,11 +224,11 @@ Codec::makeStreamingDecompressor() { "Streaming decompression is unsupported with {} format.", name())); } -std::string Codec::name() const { - return compressionKindToString(compressionKind()); -} - int32_t Codec::compressionLevel() const { return kUseDefaultCompressionLevel; } + +std::string Codec::name() const { + return compressionKindToString(compressionKind()); +} } // namespace facebook::velox::common diff --git a/velox/common/compression/Compression.h b/velox/common/compression/Compression.h index d9328f5ccd5e..8734aec9bcbd 100644 --- a/velox/common/compression/Compression.h +++ b/velox/common/compression/Compression.h @@ -218,8 +218,8 @@ class Codec { /// Note: This functionality is not universally supported by all compression /// libraries. If not supported, `std::nullopt` will be returned. virtual std::optional getUncompressedLength( - uint64_t inputLength, - const uint8_t* input) const; + const uint8_t* input, + uint64_t inputLength) const; // Create a streaming compressor instance. virtual Expected> @@ -232,12 +232,12 @@ class Codec { // This Codec's compression type. virtual CompressionKind compressionKind() const = 0; - // The name of this Codec's compression type. - std::string name() const; - // This Codec's compression level, if applicable. virtual int32_t compressionLevel() const; + // The name of this Codec's compression type. + std::string name() const; + private: // Initializes the codec's resources. virtual Status init(); diff --git a/velox/common/compression/tests/CompressionTest.cpp b/velox/common/compression/tests/CompressionTest.cpp index dbd6325af45e..6a9e60e5cd7e 100644 --- a/velox/common/compression/tests/CompressionTest.cpp +++ b/velox/common/compression/tests/CompressionTest.cpp @@ -422,11 +422,11 @@ TEST_P(CodecTest, getUncompressedLength) { if (Codec::supportsGetUncompressedLength(getCompressionKind())) { ASSERT_EQ( - codec->getUncompressedLength(compressedLength, compressed.data()), + codec->getUncompressedLength(compressed.data(), compressedLength), inputLength); } else { ASSERT_EQ( - codec->getUncompressedLength(compressedLength, compressed.data()), + codec->getUncompressedLength(compressed.data(), compressedLength), std::nullopt); } }