Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEA] Add support for using nvcomp ZSTD compression #6362

Merged
merged 2 commits into from
Nov 7, 2022
Merged
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
6 changes: 5 additions & 1 deletion integration_tests/src/main/python/orc_write_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import pytest

from asserts import assert_gpu_and_cpu_writes_are_equal_collect, assert_gpu_fallback_write
from spark_session import is_before_spark_320
from spark_session import is_before_spark_320, is_spark_cdh
from datetime import date, datetime, timezone
from data_gen import *
from marks import *
Expand Down Expand Up @@ -91,6 +91,10 @@ def test_part_write_round_trip(spark_tmp_path, orc_gen):
conf = {'spark.rapids.sql.format.orc.write.enabled': True})

orc_write_compress_options = ['none', 'uncompressed', 'snappy']
# zstd is available in spark 3.2.0 and later.
if not is_before_spark_320() and not is_spark_cdh():
orc_write_compress_options.append('zstd')

@pytest.mark.parametrize('compress', orc_write_compress_options)
def test_compress_write_round_trip(spark_tmp_path, compress):
data_path = spark_tmp_path + '/ORC_DATA'
Expand Down
4 changes: 4 additions & 0 deletions integration_tests/src/main/python/parquet_write_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,10 @@ def start(self, rand):
conf=confs)

parquet_write_compress_options = ['none', 'uncompressed', 'snappy']
# zstd is available in spark 3.2.0 and later.
if not is_before_spark_320():
parquet_write_compress_options.append('zstd')

@pytest.mark.parametrize('compress', parquet_write_compress_options)
def test_compress_write_round_trip(spark_tmp_path, compress):
data_path = spark_tmp_path + '/PARQUET_DATA'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ object GpuOrcFileFormat extends Logging {

val orcOptions = new OrcOptions(options, sqlConf)
orcOptions.compressionCodec match {
case "NONE" | "SNAPPY" =>
case "NONE" | "SNAPPY" | "ZSTD" =>
case c => meta.willNotWorkOnGpu(s"compression codec $c is not supported")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ object GpuParquetFileFormat {
compressionType match {
case "NONE" | "UNCOMPRESSED" => Some(CompressionType.NONE)
case "SNAPPY" => Some(CompressionType.SNAPPY)
case "ZSTD" => Some(CompressionType.ZSTD)
case _ => None
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ object GpuOrcFileFormat extends Logging {

val orcOptions = new OrcOptions(options, sqlConf)
orcOptions.compressionCodec match {
case "NONE" | "SNAPPY" =>
case "NONE" | "SNAPPY" | "ZSTD" =>
case c => meta.willNotWorkOnGpu(s"compression codec $c is not supported")
}

Expand Down