From 3076f33260401f1afd0298b62868f6c3162c9990 Mon Sep 17 00:00:00 2001 From: Shaun Reed Date: Wed, 19 Jul 2023 10:04:02 -0400 Subject: [PATCH] Fix unit tests --- tiledb/sm/filter/bit_width_reduction_filter.cc | 10 ++-------- tiledb/sm/filter/filter_create.cc | 4 ++-- tiledb/sm/filter/positive_delta_filter.cc | 8 ++------ tiledb/sm/filter/test/compile_webp_filter_main.cc | 3 +-- 4 files changed, 7 insertions(+), 18 deletions(-) diff --git a/tiledb/sm/filter/bit_width_reduction_filter.cc b/tiledb/sm/filter/bit_width_reduction_filter.cc index 54bdc66caf6b..e2dbbd7cf9d1 100644 --- a/tiledb/sm/filter/bit_width_reduction_filter.cc +++ b/tiledb/sm/filter/bit_width_reduction_filter.cc @@ -116,10 +116,7 @@ Status BitWidthReductionFilter::run_forward( auto data_type_size = static_cast(datatype_size(filter_data_type_)); // If bit width compression can't work, just return the input unmodified. - if ((!datatype_is_integer(filter_data_type_) && - !datatype_is_time(filter_data_type_) && - !datatype_is_datetime(filter_data_type_)) || - data_type_size == 1) { + if (!datatype_is_integer(filter_data_type_) || data_type_size == 1) { RETURN_NOT_OK(output->append_view(input)); RETURN_NOT_OK(output_metadata->append_view(input_metadata)); return Status::Ok(); @@ -301,10 +298,7 @@ Status BitWidthReductionFilter::run_reverse( auto data_type_size = static_cast(datatype_size(filter_data_type_)); // If bit width compression wasn't applied, just return the input unmodified. - if ((!datatype_is_integer(filter_data_type_) && - !datatype_is_time(filter_data_type_) && - !datatype_is_datetime(filter_data_type_)) || - data_type_size == 1) { + if (!datatype_is_integer(filter_data_type_) || data_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/filter_create.cc b/tiledb/sm/filter/filter_create.cc index 3176f6b3fb2f..404938c7d435 100644 --- a/tiledb/sm/filter/filter_create.cc +++ b/tiledb/sm/filter/filter_create.cc @@ -126,8 +126,8 @@ shared_ptr tiledb::sm::FilterCreate::deserialize( uint8_t compressor_char = deserializer.read(); int compression_level = deserializer.read(); Datatype reinterpret_type = Datatype::ANY; - if (filtertype == FilterType::FILTER_DELTA || - filtertype == FilterType::FILTER_DOUBLE_DELTA) { + if (version >= 19 && (filtertype == FilterType::FILTER_DELTA || + filtertype == FilterType::FILTER_DOUBLE_DELTA)) { uint8_t reinterpret = deserializer.read(); reinterpret_type = static_cast(reinterpret); } diff --git a/tiledb/sm/filter/positive_delta_filter.cc b/tiledb/sm/filter/positive_delta_filter.cc index 1f8b83efb61d..e2739d38e4eb 100644 --- a/tiledb/sm/filter/positive_delta_filter.cc +++ b/tiledb/sm/filter/positive_delta_filter.cc @@ -73,9 +73,7 @@ Status PositiveDeltaFilter::run_forward( FilterBuffer* output_metadata, FilterBuffer* output) const { // If encoding can't work, just return the input unmodified. - if (!datatype_is_integer(filter_data_type_) && - !datatype_is_time(filter_data_type_) && - !datatype_is_datetime(filter_data_type_)) { + if (!datatype_is_integer(filter_data_type_)) { RETURN_NOT_OK(output->append_view(input)); RETURN_NOT_OK(output_metadata->append_view(input_metadata)); return Status::Ok(); @@ -252,9 +250,7 @@ Status PositiveDeltaFilter::run_reverse( const Config& config) const { (void)config; // If encoding wasn't applied, just return the input unmodified. - if (!datatype_is_integer(filter_data_type_) && - !datatype_is_time(filter_data_type_) && - !datatype_is_datetime(filter_data_type_)) { + if (!datatype_is_integer(filter_data_type_)) { 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/test/compile_webp_filter_main.cc b/tiledb/sm/filter/test/compile_webp_filter_main.cc index c044f04a8cf5..77f9933c5621 100644 --- a/tiledb/sm/filter/test/compile_webp_filter_main.cc +++ b/tiledb/sm/filter/test/compile_webp_filter_main.cc @@ -26,10 +26,9 @@ * THE SOFTWARE. */ -#include "tiledb/sm/enums/datatype.h" #include "tiledb/sm/filter/webp_filter.h" int main() { - tiledb::sm::WebpFilter(tiledb::sm::Datatype::UINT8); + (void)sizeof(tiledb::sm::WebpFilter); return 0; }