diff --git a/cpp/src/io/comp/nvcomp_adapter.cpp b/cpp/src/io/comp/nvcomp_adapter.cpp index 5804ef3cc9b..b7b003e0af9 100644 --- a/cpp/src/io/comp/nvcomp_adapter.cpp +++ b/cpp/src/io/comp/nvcomp_adapter.cpp @@ -17,6 +17,7 @@ #include "nvcomp_adapter.cuh" #include +#include #include @@ -76,6 +77,17 @@ void batched_decompress(compression_type compression, size_t max_uncomp_chunk_size, rmm::cuda_stream_view stream) { + // TODO Consolidate config use to a common location + if (compression == compression_type::ZSTD) { +#if NVCOMP_HAS_ZSTD + CUDF_EXPECTS(cudf::io::detail::nvcomp_integration::is_all_enabled(), + "Zstandard compression is experimental, you can enable it through " + "`LIBCUDF_NVCOMP_POLICY` environment variable."); +#else + CUDF_FAIL("nvCOMP 2.3 or newer is required for Zstandard compression"); +#endif + } + auto const num_chunks = inputs.size(); // cuDF inflate inputs converted to nvcomp inputs diff --git a/python/cudf/cudf/tests/test_orc.py b/python/cudf/cudf/tests/test_orc.py index 8de680fd706..c5b6395394b 100644 --- a/python/cudf/cudf/tests/test_orc.py +++ b/python/cudf/cudf/tests/test_orc.py @@ -1727,8 +1727,5 @@ def test_orc_reader_zstd_compression(list_struct_buff): try: got = cudf.read_orc(buffer) assert_eq(expected, got) - except RuntimeError as e: - if "Unsupported compression type" in str(e): - pytest.mark.xfail(reason="nvcomp build doesn't have zstd") - else: - raise e + except RuntimeError: + pytest.mark.xfail(reason="zstd support is not enabled") diff --git a/python/cudf/cudf/tests/test_parquet.py b/python/cudf/cudf/tests/test_parquet.py index 58fa69c59d0..32619e37a3c 100644 --- a/python/cudf/cudf/tests/test_parquet.py +++ b/python/cudf/cudf/tests/test_parquet.py @@ -2515,8 +2515,5 @@ def test_parquet_reader_zstd_compression(datadir): df = cudf.read_parquet(fname) pdf = pd.read_parquet(fname) assert_eq(df, pdf) - except RuntimeError as e: - if "Unsupported compression type" in str(e): - pytest.mark.xfail(reason="nvcomp build doesn't have zstd") - else: - raise e + except RuntimeError: + pytest.mark.xfail(reason="zstd support is not enabled")