From 5e509baa3527f317535d4f4b961238bd9fd5568c Mon Sep 17 00:00:00 2001 From: Luc Rancourt Date: Fri, 14 Jul 2023 10:24:05 +0200 Subject: [PATCH] Fix backwards compatibility tests. --- tiledb/sm/enums/datatype.h | 10 +++++----- tiledb/sm/filter/bit_width_reduction_filter.cc | 6 ++++-- tiledb/sm/filter/positive_delta_filter.cc | 4 ++-- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/tiledb/sm/enums/datatype.h b/tiledb/sm/enums/datatype.h index b6f8b430dba1..dfa59ef3f420 100644 --- a/tiledb/sm/enums/datatype.h +++ b/tiledb/sm/enums/datatype.h @@ -331,11 +331,11 @@ inline bool datatype_is_string(Datatype type) { /** Returns true if the input datatype is an integer type. */ inline bool datatype_is_integer(Datatype type) { return ( - type == Datatype::BLOB || type == Datatype::BOOL || - type == Datatype::INT8 || type == Datatype::UINT8 || - type == Datatype::INT16 || type == Datatype::UINT16 || - type == Datatype::INT32 || type == Datatype::UINT32 || - type == Datatype::INT64 || type == Datatype::UINT64); + type == Datatype::BOOL || type == Datatype::INT8 || + type == Datatype::UINT8 || type == Datatype::INT16 || + type == Datatype::UINT16 || type == Datatype::INT32 || + type == Datatype::UINT32 || type == Datatype::INT64 || + type == Datatype::UINT64); } /** diff --git a/tiledb/sm/filter/bit_width_reduction_filter.cc b/tiledb/sm/filter/bit_width_reduction_filter.cc index f114382e8e4c..08c14ab68205 100644 --- a/tiledb/sm/filter/bit_width_reduction_filter.cc +++ b/tiledb/sm/filter/bit_width_reduction_filter.cc @@ -108,7 +108,8 @@ Status BitWidthReductionFilter::run_forward( auto tile_type_size = static_cast(datatype_size(tile_type)); // If bit width compression can't work, just return the input unmodified. - if (!datatype_is_integer(tile_type) || tile_type_size == 1) { + if ((!datatype_is_integer(tile_type) && tile_type != Datatype::BLOB) || + tile_type_size == 1) { RETURN_NOT_OK(output->append_view(input)); RETURN_NOT_OK(output_metadata->append_view(input_metadata)); return Status::Ok(); @@ -292,7 +293,8 @@ Status BitWidthReductionFilter::run_reverse( auto tile_type_size = static_cast(datatype_size(tile_type)); // If bit width compression wasn't applied, just return the input unmodified. - if (!datatype_is_integer(tile_type) || tile_type_size == 1) { + if ((!datatype_is_integer(tile_type) && tile_type != Datatype::BLOB) || + tile_type_size == 1) { RETURN_NOT_OK(output->append_view(input)); RETURN_NOT_OK(output_metadata->append_view(input_metadata)); return Status::Ok(); diff --git a/tiledb/sm/filter/positive_delta_filter.cc b/tiledb/sm/filter/positive_delta_filter.cc index 5b4212b8ad2f..85ed05b8b761 100644 --- a/tiledb/sm/filter/positive_delta_filter.cc +++ b/tiledb/sm/filter/positive_delta_filter.cc @@ -70,7 +70,7 @@ Status PositiveDeltaFilter::run_forward( auto tile_type = tile.type(); // If encoding can't work, just return the input unmodified. - if (!datatype_is_integer(tile_type)) { + if (!datatype_is_integer(tile_type) && tile_type != Datatype::BLOB) { RETURN_NOT_OK(output->append_view(input)); RETURN_NOT_OK(output_metadata->append_view(input_metadata)); return Status::Ok(); @@ -250,7 +250,7 @@ Status PositiveDeltaFilter::run_reverse( auto tile_type = tile.type(); // If encoding wasn't applied, just return the input unmodified. - if (!datatype_is_integer(tile_type)) { + if (!datatype_is_integer(tile_type) && tile_type != Datatype::BLOB) { RETURN_NOT_OK(output->append_view(input)); RETURN_NOT_OK(output_metadata->append_view(input_metadata)); return Status::Ok();