Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ object VeloxBackend {
}

object VeloxBackendSettings extends BackendSettingsApi {
val SHUFFLE_SUPPORTED_CODEC = Set("lz4", "zstd")
val SHUFFLE_SUPPORTED_CODEC = Set("lz4", "zstd", "snappy")
val GLUTEN_VELOX_UDF_LIB_PATHS = VeloxBackend.CONF_PREFIX + ".udfLibraryPaths"
val GLUTEN_VELOX_DRIVER_UDF_LIB_PATHS = VeloxBackend.CONF_PREFIX + ".driver.udfLibraryPaths"
val GLUTEN_VELOX_INTERNAL_UDF_LIB_PATHS = VeloxBackend.CONF_PREFIX + ".internal.udfLibraryPaths"
Expand Down
6 changes: 6 additions & 0 deletions cpp/core/utils/Compression.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,15 @@ std::unique_ptr<arrow::util::Codec>
createCompressionCodec(arrow::Compression::type compressedType, CodecBackend codecBackend, int32_t compressionLevel) {
std::unique_ptr<arrow::util::Codec> codec;
switch (compressedType) {
case arrow::Compression::UNCOMPRESSED: {
return nullptr;
}
case arrow::Compression::LZ4_FRAME: {
GLUTEN_ASSIGN_OR_THROW(codec, arrow::util::Codec::Create(compressedType));
} break;
case arrow::Compression::SNAPPY: {
GLUTEN_ASSIGN_OR_THROW(codec, arrow::util::Codec::Create(compressedType));
} break;
case arrow::Compression::ZSTD: {
if (codecBackend == CodecBackend::NONE) {
GLUTEN_ASSIGN_OR_THROW(codec, arrow::util::Codec::Create(compressedType, compressionLevel));
Expand Down
5 changes: 4 additions & 1 deletion cpp/velox/tests/VeloxGpuShuffleWriterTest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,10 @@ std::vector<GpuShuffleTestParams> getTestParams() {
}

const std::vector<arrow::Compression::type> compressions = {
arrow::Compression::UNCOMPRESSED, arrow::Compression::LZ4_FRAME, arrow::Compression::ZSTD};
arrow::Compression::UNCOMPRESSED,
arrow::Compression::LZ4_FRAME,
arrow::Compression::ZSTD,
arrow::Compression::SNAPPY};
const std::vector<int32_t> compressionThresholds = {-1, 0, 3, 4, 10, 4096};
const std::vector<int32_t> mergeBufferSizes = {0, 3, 4, 10, 4096};

Expand Down
5 changes: 4 additions & 1 deletion cpp/velox/tests/VeloxShuffleWriterTest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,10 @@ std::vector<ShuffleTestParams> getTestParams() {
}

const std::vector<arrow::Compression::type> compressions = {
arrow::Compression::UNCOMPRESSED, arrow::Compression::LZ4_FRAME, arrow::Compression::ZSTD};
arrow::Compression::UNCOMPRESSED,
arrow::Compression::LZ4_FRAME,
arrow::Compression::ZSTD,
arrow::Compression::SNAPPY};
const std::vector<int32_t> compressionThresholds = {-1, 0, 3, 4, 10, 4096};
const std::vector<int32_t> mergeBufferSizes = {0, 3, 4, 10, 4096};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ object GlutenShuffleUtils {
checkAndGetBufferSize(IO_COMPRESSION_LZ4_BLOCKSIZE)
} else if ("zstd" == codec) {
checkAndGetBufferSize(IO_COMPRESSION_ZSTD_BUFFERSIZE)
} else if ("snappy" == codec) {
checkAndGetBufferSize(IO_COMPRESSION_SNAPPY_BLOCKSIZE)
} else if ("gzip" == codec) { // QAT supports it only.
// Temporarily hard-coded to 32k.
32 * 1024
Expand Down
Loading