diff --git a/be/src/vec/functions/array/function_array_index.h b/be/src/vec/functions/array/function_array_index.h index d3c9feb5934ae5..7e709bfd817ba2 100644 --- a/be/src/vec/functions/array/function_array_index.h +++ b/be/src/vec/functions/array/function_array_index.h @@ -127,9 +127,9 @@ class FunctionArrayIndex : public IFunction { RETURN_IF_ERROR(iter->read_null_bitmap(&null_bitmap_cache_handle)); null_bitmap = null_bitmap_cache_handle.get_bitmap(); } - std::unique_ptr query_param = nullptr; - RETURN_IF_ERROR(InvertedIndexQueryParamFactory::create_query_value(param_type, ¶m_value, - query_param)); + std::unique_ptr query_param = nullptr; + RETURN_IF_ERROR(segment_v2::InvertedIndexQueryParamFactory::create_query_value( + param_type, ¶m_value, query_param)); RETURN_IF_ERROR(iter->read_from_inverted_index( data_type_with_name.first, query_param->get_value(), segment_v2::InvertedIndexQueryType::EQUAL_QUERY, num_rows, roaring)); diff --git a/be/src/vec/functions/array/function_arrays_overlap.h b/be/src/vec/functions/array/function_arrays_overlap.h index 815ba728259a37..fac5264d027f33 100644 --- a/be/src/vec/functions/array/function_arrays_overlap.h +++ b/be/src/vec/functions/array/function_arrays_overlap.h @@ -181,12 +181,16 @@ class FunctionArraysOverlap : public IFunction { RETURN_IF_ERROR(iter->read_null_bitmap(&null_bitmap_cache_handle)); null_bitmap = null_bitmap_cache_handle.get_bitmap(); } - std::unique_ptr query_param = nullptr; + std::unique_ptr query_param = nullptr; const Array& query_val = param_value.get(); - for (size_t i = 0; i < query_val.size(); ++i) { - Field nested_query_val = query_val[i]; + for (auto nested_query_val : query_val) { + // any element inside array is NULL, return NULL + // by current arrays_overlap execute logic. + if (nested_query_val.is_null()) { + return Status::OK(); + } std::shared_ptr single_res = std::make_shared(); - RETURN_IF_ERROR(InvertedIndexQueryParamFactory::create_query_value( + RETURN_IF_ERROR(segment_v2::InvertedIndexQueryParamFactory::create_query_value( nested_param_type, &nested_query_val, query_param)); RETURN_IF_ERROR(iter->read_from_inverted_index( data_type_with_name.first, query_param->get_value(), diff --git a/regression-test/data/inverted_index_p0/test_array_contains_with_inverted_index.out b/regression-test/data/inverted_index_p0/test_array_contains_with_inverted_index.out index 9dae44af05d6f3..a93c7e2a2cf36a 100644 --- a/regression-test/data/inverted_index_p0/test_array_contains_with_inverted_index.out +++ b/regression-test/data/inverted_index_p0/test_array_contains_with_inverted_index.out @@ -242,8 +242,30 @@ 2019-01-01 a648a447b8f71522f11632eba4b4adde ["p", "q", "r", "s", "t"] -- !sql -- +2019-01-01 a648a447b8f71522f11632eba4b4adde ["p", "q", "r", "s", "t"] + +-- !sql -- + +-- !sql -- + +-- !sql -- +2019-01-01 a648a447b8f71522f11632eba4b4adde ["p", "q", "r", "s", "t"] + +-- !sql -- +2019-01-01 a648a447b8f71522f11632eba4b4adde ["p", "q", "r", "s", "t"] -- !sql -- +2017-01-01 021603e7dcfe65d44af0efd0e5aee154 ["n"] +2017-01-01 48a33ec3453a28bce84b8f96fe161956 ["m"] +2017-01-01 6afef581285b6608bf80d5a4e46cf839 ["a", "b", "c"] +2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a3 \N +2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a4 \N +2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a5 [] +2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a6 [null, null, null] +2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a7 [null, null, null] +2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a8 [] +2017-01-01 9fcb57ae675f0af4d613d9e6c0e8a2a2 ["o"] +2017-01-01 d93d942d985a8fb7547c72dada8d332d ["d", "e", "f", "g", "h", "i", "j", "k", "l"] 2019-01-01 a648a447b8f71522f11632eba4b4adde ["p", "q", "r", "s", "t"] -- !sql -- @@ -275,6 +297,19 @@ 2019-01-01 a9fb5c985c90bf05f3bee5ca3ae95260 ["u", "v"] 2019-01-01 ee27ee1da291e46403c408e220bed6e1 ["y"] +-- !sql -- +2017-01-01 021603e7dcfe65d44af0efd0e5aee154 ["n"] +2017-01-01 48a33ec3453a28bce84b8f96fe161956 ["m"] +2017-01-01 6afef581285b6608bf80d5a4e46cf839 ["a", "b", "c"] +2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a5 [] +2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a8 [] +2017-01-01 9fcb57ae675f0af4d613d9e6c0e8a2a2 ["o"] +2017-01-01 d93d942d985a8fb7547c72dada8d332d ["d", "e", "f", "g", "h", "i", "j", "k", "l"] +2019-01-01 0974e7a82e30d1af83205e474fadd0a2 ["w"] +2019-01-01 26823b3995ee38bd145ddd910b2f6300 ["x"] +2019-01-01 a9fb5c985c90bf05f3bee5ca3ae95260 ["u", "v"] +2019-01-01 ee27ee1da291e46403c408e220bed6e1 ["y"] + -- !sql -- 2017-01-01 021603e7dcfe65d44af0efd0e5aee154 ["n"] 2017-01-01 48a33ec3453a28bce84b8f96fe161956 ["m"] @@ -286,12 +321,44 @@ 2017-01-01 9fcb57ae675f0af4d613d9e6c0e8a2a2 ["o"] 2017-01-01 d93d942d985a8fb7547c72dada8d332d ["d", "e", "f", "g", "h", "i", "j", "k", "l"] +-- !sql -- +2017-01-01 021603e7dcfe65d44af0efd0e5aee154 ["n"] +2017-01-01 48a33ec3453a28bce84b8f96fe161956 ["m"] +2017-01-01 6afef581285b6608bf80d5a4e46cf839 ["a", "b", "c"] +2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a5 [] +2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a8 [] +2017-01-01 9fcb57ae675f0af4d613d9e6c0e8a2a2 ["o"] +2017-01-01 d93d942d985a8fb7547c72dada8d332d ["d", "e", "f", "g", "h", "i", "j", "k", "l"] + -- !sql -- 2019-01-01 0974e7a82e30d1af83205e474fadd0a2 ["w"] 2019-01-01 26823b3995ee38bd145ddd910b2f6300 ["x"] 2019-01-01 a9fb5c985c90bf05f3bee5ca3ae95260 ["u", "v"] 2019-01-01 ee27ee1da291e46403c408e220bed6e1 ["y"] +-- !sql -- +2019-01-01 0974e7a82e30d1af83205e474fadd0a2 ["w"] +2019-01-01 26823b3995ee38bd145ddd910b2f6300 ["x"] +2019-01-01 a9fb5c985c90bf05f3bee5ca3ae95260 ["u", "v"] +2019-01-01 ee27ee1da291e46403c408e220bed6e1 ["y"] + +-- !sql -- +2017-01-01 021603e7dcfe65d44af0efd0e5aee154 ["n"] +2017-01-01 48a33ec3453a28bce84b8f96fe161956 ["m"] +2017-01-01 6afef581285b6608bf80d5a4e46cf839 ["a", "b", "c"] +2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a3 \N +2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a4 \N +2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a5 [] +2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a6 [null, null, null] +2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a7 [null, null, null] +2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a8 [] +2017-01-01 9fcb57ae675f0af4d613d9e6c0e8a2a2 ["o"] +2017-01-01 d93d942d985a8fb7547c72dada8d332d ["d", "e", "f", "g", "h", "i", "j", "k", "l"] +2019-01-01 0974e7a82e30d1af83205e474fadd0a2 ["w"] +2019-01-01 26823b3995ee38bd145ddd910b2f6300 ["x"] +2019-01-01 a9fb5c985c90bf05f3bee5ca3ae95260 ["u", "v"] +2019-01-01 ee27ee1da291e46403c408e220bed6e1 ["y"] + -- !sql -- 2017-01-01 021603e7dcfe65d44af0efd0e5aee154 ["n"] 2017-01-01 48a33ec3453a28bce84b8f96fe161956 ["m"] @@ -316,6 +383,19 @@ 2019-01-01 a9fb5c985c90bf05f3bee5ca3ae95260 ["u", "v"] 2019-01-01 ee27ee1da291e46403c408e220bed6e1 ["y"] +-- !sql -- +2019-01-01 0974e7a82e30d1af83205e474fadd0a2 ["w"] +2019-01-01 26823b3995ee38bd145ddd910b2f6300 ["x"] +2019-01-01 a648a447b8f71522f11632eba4b4adde ["p", "q", "r", "s", "t"] +2019-01-01 a9fb5c985c90bf05f3bee5ca3ae95260 ["u", "v"] +2019-01-01 ee27ee1da291e46403c408e220bed6e1 ["y"] + +-- !sql -- + +-- !sql -- + +-- !sql -- + -- !sql -- -- !sql -- @@ -335,6 +415,19 @@ 2017-01-01 9fcb57ae675f0af4d613d9e6c0e8a2a2 ["o"] 2017-01-01 d93d942d985a8fb7547c72dada8d332d ["d", "e", "f", "g", "h", "i", "j", "k", "l"] +-- !sql -- +2017-01-01 021603e7dcfe65d44af0efd0e5aee154 ["n"] +2017-01-01 48a33ec3453a28bce84b8f96fe161956 ["m"] +2017-01-01 6afef581285b6608bf80d5a4e46cf839 ["a", "b", "c"] +2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a3 \N +2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a4 \N +2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a5 [] +2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a6 [null, null, null] +2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a7 [null, null, null] +2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a8 [] +2017-01-01 9fcb57ae675f0af4d613d9e6c0e8a2a2 ["o"] +2017-01-01 d93d942d985a8fb7547c72dada8d332d ["d", "e", "f", "g", "h", "i", "j", "k", "l"] + -- !sql -- 2017-01-01 021603e7dcfe65d44af0efd0e5aee154 ["n"] 2017-01-01 48a33ec3453a28bce84b8f96fe161956 ["m"] @@ -351,6 +444,20 @@ 2019-01-01 a9fb5c985c90bf05f3bee5ca3ae95260 ["u", "v"] 2019-01-01 ee27ee1da291e46403c408e220bed6e1 ["y"] +-- !sql -- +2017-01-01 021603e7dcfe65d44af0efd0e5aee154 ["n"] +2017-01-01 48a33ec3453a28bce84b8f96fe161956 ["m"] +2017-01-01 6afef581285b6608bf80d5a4e46cf839 ["a", "b", "c"] +2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a5 [] +2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a8 [] +2017-01-01 9fcb57ae675f0af4d613d9e6c0e8a2a2 ["o"] +2017-01-01 d93d942d985a8fb7547c72dada8d332d ["d", "e", "f", "g", "h", "i", "j", "k", "l"] +2019-01-01 0974e7a82e30d1af83205e474fadd0a2 ["w"] +2019-01-01 26823b3995ee38bd145ddd910b2f6300 ["x"] +2019-01-01 a648a447b8f71522f11632eba4b4adde ["p", "q", "r", "s", "t"] +2019-01-01 a9fb5c985c90bf05f3bee5ca3ae95260 ["u", "v"] +2019-01-01 ee27ee1da291e46403c408e220bed6e1 ["y"] + -- !sql -- 2017-01-01 021603e7dcfe65d44af0efd0e5aee154 ["n"] 2017-01-01 48a33ec3453a28bce84b8f96fe161956 ["m"] @@ -362,6 +469,22 @@ 2017-01-01 9fcb57ae675f0af4d613d9e6c0e8a2a2 ["o"] 2017-01-01 d93d942d985a8fb7547c72dada8d332d ["d", "e", "f", "g", "h", "i", "j", "k", "l"] +-- !sql -- +2017-01-01 021603e7dcfe65d44af0efd0e5aee154 ["n"] +2017-01-01 48a33ec3453a28bce84b8f96fe161956 ["m"] +2017-01-01 6afef581285b6608bf80d5a4e46cf839 ["a", "b", "c"] +2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a5 [] +2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a8 [] +2017-01-01 9fcb57ae675f0af4d613d9e6c0e8a2a2 ["o"] +2017-01-01 d93d942d985a8fb7547c72dada8d332d ["d", "e", "f", "g", "h", "i", "j", "k", "l"] + +-- !sql -- +2019-01-01 0974e7a82e30d1af83205e474fadd0a2 ["w"] +2019-01-01 26823b3995ee38bd145ddd910b2f6300 ["x"] +2019-01-01 a648a447b8f71522f11632eba4b4adde ["p", "q", "r", "s", "t"] +2019-01-01 a9fb5c985c90bf05f3bee5ca3ae95260 ["u", "v"] +2019-01-01 ee27ee1da291e46403c408e220bed6e1 ["y"] + -- !sql -- 2019-01-01 0974e7a82e30d1af83205e474fadd0a2 ["w"] 2019-01-01 26823b3995ee38bd145ddd910b2f6300 ["x"] @@ -387,6 +510,31 @@ 2019-01-01 a9fb5c985c90bf05f3bee5ca3ae95260 ["u", "v"] 2019-01-01 ee27ee1da291e46403c408e220bed6e1 ["y"] +-- !sql -- +2017-01-01 021603e7dcfe65d44af0efd0e5aee154 ["n"] +2017-01-01 48a33ec3453a28bce84b8f96fe161956 ["m"] +2017-01-01 6afef581285b6608bf80d5a4e46cf839 ["a", "b", "c"] +2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a3 \N +2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a4 \N +2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a5 [] +2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a6 [null, null, null] +2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a7 [null, null, null] +2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a8 [] +2017-01-01 9fcb57ae675f0af4d613d9e6c0e8a2a2 ["o"] +2017-01-01 d93d942d985a8fb7547c72dada8d332d ["d", "e", "f", "g", "h", "i", "j", "k", "l"] +2019-01-01 0974e7a82e30d1af83205e474fadd0a2 ["w"] +2019-01-01 26823b3995ee38bd145ddd910b2f6300 ["x"] +2019-01-01 a648a447b8f71522f11632eba4b4adde ["p", "q", "r", "s", "t"] +2019-01-01 a9fb5c985c90bf05f3bee5ca3ae95260 ["u", "v"] +2019-01-01 ee27ee1da291e46403c408e220bed6e1 ["y"] + +-- !sql -- +2019-01-01 0974e7a82e30d1af83205e474fadd0a2 ["w"] +2019-01-01 26823b3995ee38bd145ddd910b2f6300 ["x"] +2019-01-01 a648a447b8f71522f11632eba4b4adde ["p", "q", "r", "s", "t"] +2019-01-01 a9fb5c985c90bf05f3bee5ca3ae95260 ["u", "v"] +2019-01-01 ee27ee1da291e46403c408e220bed6e1 ["y"] + -- !sql -- 2019-01-01 0974e7a82e30d1af83205e474fadd0a2 ["w"] 2019-01-01 26823b3995ee38bd145ddd910b2f6300 ["x"] @@ -400,6 +548,12 @@ -- !sql -- +-- !sql -- + +-- !sql -- + +-- !sql -- + -- !sql -- 2017-01-01 021603e7dcfe65d44af0efd0e5aee154 ["n"] 2017-01-01 48a33ec3453a28bce84b8f96fe161956 ["m"] @@ -413,6 +567,25 @@ 2017-01-01 9fcb57ae675f0af4d613d9e6c0e8a2a2 ["o"] 2017-01-01 d93d942d985a8fb7547c72dada8d332d ["d", "e", "f", "g", "h", "i", "j", "k", "l"] +-- !sql -- +2017-01-01 021603e7dcfe65d44af0efd0e5aee154 ["n"] +2017-01-01 48a33ec3453a28bce84b8f96fe161956 ["m"] +2017-01-01 6afef581285b6608bf80d5a4e46cf839 ["a", "b", "c"] +2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a3 \N +2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a4 \N +2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a5 [] +2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a6 [null, null, null] +2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a7 [null, null, null] +2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a8 [] +2017-01-01 9fcb57ae675f0af4d613d9e6c0e8a2a2 ["o"] +2017-01-01 d93d942d985a8fb7547c72dada8d332d ["d", "e", "f", "g", "h", "i", "j", "k", "l"] + +-- !sql -- + +-- !sql -- + +-- !sql -- + -- !sql -- -- !sql -- @@ -432,6 +605,19 @@ 2017-01-01 9fcb57ae675f0af4d613d9e6c0e8a2a2 ["o"] 2017-01-01 d93d942d985a8fb7547c72dada8d332d ["d", "e", "f", "g", "h", "i", "j", "k", "l"] +-- !sql -- +2017-01-01 021603e7dcfe65d44af0efd0e5aee154 ["n"] +2017-01-01 48a33ec3453a28bce84b8f96fe161956 ["m"] +2017-01-01 6afef581285b6608bf80d5a4e46cf839 ["a", "b", "c"] +2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a3 \N +2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a4 \N +2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a5 [] +2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a6 [null, null, null] +2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a7 [null, null, null] +2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a8 [] +2017-01-01 9fcb57ae675f0af4d613d9e6c0e8a2a2 ["o"] +2017-01-01 d93d942d985a8fb7547c72dada8d332d ["d", "e", "f", "g", "h", "i", "j", "k", "l"] + -- !sql -- 2019-01-01 0974e7a82e30d1af83205e474fadd0a2 ["w"] 2019-01-01 26823b3995ee38bd145ddd910b2f6300 ["x"] @@ -440,13 +626,42 @@ 2019-01-01 ee27ee1da291e46403c408e220bed6e1 ["y"] -- !sql -- +2019-01-01 0974e7a82e30d1af83205e474fadd0a2 ["w"] +2019-01-01 26823b3995ee38bd145ddd910b2f6300 ["x"] 2019-01-01 a648a447b8f71522f11632eba4b4adde ["p", "q", "r", "s", "t"] +2019-01-01 a9fb5c985c90bf05f3bee5ca3ae95260 ["u", "v"] +2019-01-01 ee27ee1da291e46403c408e220bed6e1 ["y"] + +-- !sql -- +2019-01-01 a648a447b8f71522f11632eba4b4adde ["p", "q", "r", "s", "t"] + +-- !sql -- +2019-01-01 a648a447b8f71522f11632eba4b4adde ["p", "q", "r", "s", "t"] + +-- !sql -- -- !sql -- -- !sql -- 2019-01-01 a648a447b8f71522f11632eba4b4adde ["p", "q", "r", "s", "t"] +-- !sql -- +2019-01-01 a648a447b8f71522f11632eba4b4adde ["p", "q", "r", "s", "t"] + +-- !sql -- +2017-01-01 021603e7dcfe65d44af0efd0e5aee154 ["n"] +2017-01-01 48a33ec3453a28bce84b8f96fe161956 ["m"] +2017-01-01 6afef581285b6608bf80d5a4e46cf839 ["a", "b", "c"] +2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a3 \N +2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a4 \N +2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a5 [] +2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a6 [null, null, null] +2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a7 [null, null, null] +2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a8 [] +2017-01-01 9fcb57ae675f0af4d613d9e6c0e8a2a2 ["o"] +2017-01-01 d93d942d985a8fb7547c72dada8d332d ["d", "e", "f", "g", "h", "i", "j", "k", "l"] +2019-01-01 a648a447b8f71522f11632eba4b4adde ["p", "q", "r", "s", "t"] + -- !sql -- 2017-01-01 021603e7dcfe65d44af0efd0e5aee154 ["n"] 2017-01-01 48a33ec3453a28bce84b8f96fe161956 ["m"] @@ -476,6 +691,19 @@ 2019-01-01 a9fb5c985c90bf05f3bee5ca3ae95260 ["u", "v"] 2019-01-01 ee27ee1da291e46403c408e220bed6e1 ["y"] +-- !sql -- +2017-01-01 021603e7dcfe65d44af0efd0e5aee154 ["n"] +2017-01-01 48a33ec3453a28bce84b8f96fe161956 ["m"] +2017-01-01 6afef581285b6608bf80d5a4e46cf839 ["a", "b", "c"] +2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a5 [] +2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a8 [] +2017-01-01 9fcb57ae675f0af4d613d9e6c0e8a2a2 ["o"] +2017-01-01 d93d942d985a8fb7547c72dada8d332d ["d", "e", "f", "g", "h", "i", "j", "k", "l"] +2019-01-01 0974e7a82e30d1af83205e474fadd0a2 ["w"] +2019-01-01 26823b3995ee38bd145ddd910b2f6300 ["x"] +2019-01-01 a9fb5c985c90bf05f3bee5ca3ae95260 ["u", "v"] +2019-01-01 ee27ee1da291e46403c408e220bed6e1 ["y"] + -- !sql -- 2017-01-01 021603e7dcfe65d44af0efd0e5aee154 ["n"] 2017-01-01 48a33ec3453a28bce84b8f96fe161956 ["m"] @@ -488,6 +716,38 @@ 2017-01-01 d93d942d985a8fb7547c72dada8d332d ["d", "e", "f", "g", "h", "i", "j", "k", "l"] -- !sql -- +2017-01-01 021603e7dcfe65d44af0efd0e5aee154 ["n"] +2017-01-01 48a33ec3453a28bce84b8f96fe161956 ["m"] +2017-01-01 6afef581285b6608bf80d5a4e46cf839 ["a", "b", "c"] +2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a5 [] +2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a8 [] +2017-01-01 9fcb57ae675f0af4d613d9e6c0e8a2a2 ["o"] +2017-01-01 d93d942d985a8fb7547c72dada8d332d ["d", "e", "f", "g", "h", "i", "j", "k", "l"] + +-- !sql -- +2019-01-01 0974e7a82e30d1af83205e474fadd0a2 ["w"] +2019-01-01 26823b3995ee38bd145ddd910b2f6300 ["x"] +2019-01-01 a9fb5c985c90bf05f3bee5ca3ae95260 ["u", "v"] +2019-01-01 ee27ee1da291e46403c408e220bed6e1 ["y"] + +-- !sql -- +2019-01-01 0974e7a82e30d1af83205e474fadd0a2 ["w"] +2019-01-01 26823b3995ee38bd145ddd910b2f6300 ["x"] +2019-01-01 a9fb5c985c90bf05f3bee5ca3ae95260 ["u", "v"] +2019-01-01 ee27ee1da291e46403c408e220bed6e1 ["y"] + +-- !sql -- +2017-01-01 021603e7dcfe65d44af0efd0e5aee154 ["n"] +2017-01-01 48a33ec3453a28bce84b8f96fe161956 ["m"] +2017-01-01 6afef581285b6608bf80d5a4e46cf839 ["a", "b", "c"] +2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a3 \N +2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a4 \N +2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a5 [] +2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a6 [null, null, null] +2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a7 [null, null, null] +2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a8 [] +2017-01-01 9fcb57ae675f0af4d613d9e6c0e8a2a2 ["o"] +2017-01-01 d93d942d985a8fb7547c72dada8d332d ["d", "e", "f", "g", "h", "i", "j", "k", "l"] 2019-01-01 0974e7a82e30d1af83205e474fadd0a2 ["w"] 2019-01-01 26823b3995ee38bd145ddd910b2f6300 ["x"] 2019-01-01 a9fb5c985c90bf05f3bee5ca3ae95260 ["u", "v"] @@ -518,12 +778,23 @@ 2019-01-01 ee27ee1da291e46403c408e220bed6e1 ["y"] -- !sql -- +2019-01-01 0974e7a82e30d1af83205e474fadd0a2 ["w"] +2019-01-01 26823b3995ee38bd145ddd910b2f6300 ["x"] 2019-01-01 a648a447b8f71522f11632eba4b4adde ["p", "q", "r", "s", "t"] +2019-01-01 a9fb5c985c90bf05f3bee5ca3ae95260 ["u", "v"] +2019-01-01 ee27ee1da291e46403c408e220bed6e1 ["y"] + +-- !sql -- + +-- !sql -- + +-- !sql -- + +-- !sql -- -- !sql -- -- !sql -- -2019-01-01 a648a447b8f71522f11632eba4b4adde ["p", "q", "r", "s", "t"] -- !sql -- 2017-01-01 021603e7dcfe65d44af0efd0e5aee154 ["n"] @@ -537,27 +808,38 @@ 2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a8 [] 2017-01-01 9fcb57ae675f0af4d613d9e6c0e8a2a2 ["o"] 2017-01-01 d93d942d985a8fb7547c72dada8d332d ["d", "e", "f", "g", "h", "i", "j", "k", "l"] -2019-01-01 a648a447b8f71522f11632eba4b4adde ["p", "q", "r", "s", "t"] -- !sql -- 2017-01-01 021603e7dcfe65d44af0efd0e5aee154 ["n"] 2017-01-01 48a33ec3453a28bce84b8f96fe161956 ["m"] 2017-01-01 6afef581285b6608bf80d5a4e46cf839 ["a", "b", "c"] +2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a3 \N +2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a4 \N 2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a5 [] 2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a6 [null, null, null] 2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a7 [null, null, null] 2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a8 [] 2017-01-01 9fcb57ae675f0af4d613d9e6c0e8a2a2 ["o"] 2017-01-01 d93d942d985a8fb7547c72dada8d332d ["d", "e", "f", "g", "h", "i", "j", "k", "l"] -2019-01-01 0974e7a82e30d1af83205e474fadd0a2 ["w"] -2019-01-01 26823b3995ee38bd145ddd910b2f6300 ["x"] -2019-01-01 a9fb5c985c90bf05f3bee5ca3ae95260 ["u", "v"] -2019-01-01 ee27ee1da291e46403c408e220bed6e1 ["y"] + +-- !sql -- + +-- !sql -- + +-- !sql -- + +-- !sql -- + +-- !sql -- + +-- !sql -- -- !sql -- 2017-01-01 021603e7dcfe65d44af0efd0e5aee154 ["n"] 2017-01-01 48a33ec3453a28bce84b8f96fe161956 ["m"] 2017-01-01 6afef581285b6608bf80d5a4e46cf839 ["a", "b", "c"] +2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a3 \N +2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a4 \N 2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a5 [] 2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a6 [null, null, null] 2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a7 [null, null, null] @@ -565,12 +847,6 @@ 2017-01-01 9fcb57ae675f0af4d613d9e6c0e8a2a2 ["o"] 2017-01-01 d93d942d985a8fb7547c72dada8d332d ["d", "e", "f", "g", "h", "i", "j", "k", "l"] --- !sql -- -2019-01-01 0974e7a82e30d1af83205e474fadd0a2 ["w"] -2019-01-01 26823b3995ee38bd145ddd910b2f6300 ["x"] -2019-01-01 a9fb5c985c90bf05f3bee5ca3ae95260 ["u", "v"] -2019-01-01 ee27ee1da291e46403c408e220bed6e1 ["y"] - -- !sql -- 2017-01-01 021603e7dcfe65d44af0efd0e5aee154 ["n"] 2017-01-01 48a33ec3453a28bce84b8f96fe161956 ["m"] @@ -583,8 +859,11 @@ 2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a8 [] 2017-01-01 9fcb57ae675f0af4d613d9e6c0e8a2a2 ["o"] 2017-01-01 d93d942d985a8fb7547c72dada8d332d ["d", "e", "f", "g", "h", "i", "j", "k", "l"] + +-- !sql -- 2019-01-01 0974e7a82e30d1af83205e474fadd0a2 ["w"] 2019-01-01 26823b3995ee38bd145ddd910b2f6300 ["x"] +2019-01-01 a648a447b8f71522f11632eba4b4adde ["p", "q", "r", "s", "t"] 2019-01-01 a9fb5c985c90bf05f3bee5ca3ae95260 ["u", "v"] 2019-01-01 ee27ee1da291e46403c408e220bed6e1 ["y"] @@ -601,6 +880,12 @@ -- !sql -- +-- !sql -- + +-- !sql -- + +-- !sql -- + -- !sql -- 2017-01-01 021603e7dcfe65d44af0efd0e5aee154 ["n"] 2017-01-01 48a33ec3453a28bce84b8f96fe161956 ["m"] @@ -618,22 +903,33 @@ 2017-01-01 021603e7dcfe65d44af0efd0e5aee154 ["n"] 2017-01-01 48a33ec3453a28bce84b8f96fe161956 ["m"] 2017-01-01 6afef581285b6608bf80d5a4e46cf839 ["a", "b", "c"] +2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a3 \N +2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a4 \N 2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a5 [] 2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a6 [null, null, null] 2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a7 [null, null, null] 2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a8 [] 2017-01-01 9fcb57ae675f0af4d613d9e6c0e8a2a2 ["o"] 2017-01-01 d93d942d985a8fb7547c72dada8d332d ["d", "e", "f", "g", "h", "i", "j", "k", "l"] -2019-01-01 0974e7a82e30d1af83205e474fadd0a2 ["w"] -2019-01-01 26823b3995ee38bd145ddd910b2f6300 ["x"] -2019-01-01 a648a447b8f71522f11632eba4b4adde ["p", "q", "r", "s", "t"] -2019-01-01 a9fb5c985c90bf05f3bee5ca3ae95260 ["u", "v"] -2019-01-01 ee27ee1da291e46403c408e220bed6e1 ["y"] + +-- !sql -- + +-- !sql -- + +-- !sql -- + +-- !sql -- + +-- !sql -- + +-- !sql -- -- !sql -- 2017-01-01 021603e7dcfe65d44af0efd0e5aee154 ["n"] 2017-01-01 48a33ec3453a28bce84b8f96fe161956 ["m"] 2017-01-01 6afef581285b6608bf80d5a4e46cf839 ["a", "b", "c"] +2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a3 \N +2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a4 \N 2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a5 [] 2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a6 [null, null, null] 2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a7 [null, null, null] @@ -641,13 +937,6 @@ 2017-01-01 9fcb57ae675f0af4d613d9e6c0e8a2a2 ["o"] 2017-01-01 d93d942d985a8fb7547c72dada8d332d ["d", "e", "f", "g", "h", "i", "j", "k", "l"] --- !sql -- -2019-01-01 0974e7a82e30d1af83205e474fadd0a2 ["w"] -2019-01-01 26823b3995ee38bd145ddd910b2f6300 ["x"] -2019-01-01 a648a447b8f71522f11632eba4b4adde ["p", "q", "r", "s", "t"] -2019-01-01 a9fb5c985c90bf05f3bee5ca3ae95260 ["u", "v"] -2019-01-01 ee27ee1da291e46403c408e220bed6e1 ["y"] - -- !sql -- 2017-01-01 021603e7dcfe65d44af0efd0e5aee154 ["n"] 2017-01-01 48a33ec3453a28bce84b8f96fe161956 ["m"] @@ -660,6 +949,8 @@ 2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a8 [] 2017-01-01 9fcb57ae675f0af4d613d9e6c0e8a2a2 ["o"] 2017-01-01 d93d942d985a8fb7547c72dada8d332d ["d", "e", "f", "g", "h", "i", "j", "k", "l"] + +-- !sql -- 2019-01-01 0974e7a82e30d1af83205e474fadd0a2 ["w"] 2019-01-01 26823b3995ee38bd145ddd910b2f6300 ["x"] 2019-01-01 a648a447b8f71522f11632eba4b4adde ["p", "q", "r", "s", "t"] @@ -674,12 +965,16 @@ 2019-01-01 ee27ee1da291e46403c408e220bed6e1 ["y"] -- !sql -- -2019-01-01 a648a447b8f71522f11632eba4b4adde ["p", "q", "r", "s", "t"] -- !sql -- -- !sql -- -2019-01-01 a648a447b8f71522f11632eba4b4adde ["p", "q", "r", "s", "t"] + +-- !sql -- + +-- !sql -- + +-- !sql -- -- !sql -- 2017-01-01 021603e7dcfe65d44af0efd0e5aee154 ["n"] @@ -693,27 +988,38 @@ 2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a8 [] 2017-01-01 9fcb57ae675f0af4d613d9e6c0e8a2a2 ["o"] 2017-01-01 d93d942d985a8fb7547c72dada8d332d ["d", "e", "f", "g", "h", "i", "j", "k", "l"] -2019-01-01 a648a447b8f71522f11632eba4b4adde ["p", "q", "r", "s", "t"] -- !sql -- 2017-01-01 021603e7dcfe65d44af0efd0e5aee154 ["n"] 2017-01-01 48a33ec3453a28bce84b8f96fe161956 ["m"] 2017-01-01 6afef581285b6608bf80d5a4e46cf839 ["a", "b", "c"] +2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a3 \N +2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a4 \N 2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a5 [] 2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a6 [null, null, null] 2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a7 [null, null, null] 2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a8 [] 2017-01-01 9fcb57ae675f0af4d613d9e6c0e8a2a2 ["o"] 2017-01-01 d93d942d985a8fb7547c72dada8d332d ["d", "e", "f", "g", "h", "i", "j", "k", "l"] -2019-01-01 0974e7a82e30d1af83205e474fadd0a2 ["w"] -2019-01-01 26823b3995ee38bd145ddd910b2f6300 ["x"] -2019-01-01 a9fb5c985c90bf05f3bee5ca3ae95260 ["u", "v"] -2019-01-01 ee27ee1da291e46403c408e220bed6e1 ["y"] + +-- !sql -- + +-- !sql -- + +-- !sql -- + +-- !sql -- + +-- !sql -- + +-- !sql -- -- !sql -- 2017-01-01 021603e7dcfe65d44af0efd0e5aee154 ["n"] 2017-01-01 48a33ec3453a28bce84b8f96fe161956 ["m"] 2017-01-01 6afef581285b6608bf80d5a4e46cf839 ["a", "b", "c"] +2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a3 \N +2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a4 \N 2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a5 [] 2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a6 [null, null, null] 2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a7 [null, null, null] @@ -721,12 +1027,6 @@ 2017-01-01 9fcb57ae675f0af4d613d9e6c0e8a2a2 ["o"] 2017-01-01 d93d942d985a8fb7547c72dada8d332d ["d", "e", "f", "g", "h", "i", "j", "k", "l"] --- !sql -- -2019-01-01 0974e7a82e30d1af83205e474fadd0a2 ["w"] -2019-01-01 26823b3995ee38bd145ddd910b2f6300 ["x"] -2019-01-01 a9fb5c985c90bf05f3bee5ca3ae95260 ["u", "v"] -2019-01-01 ee27ee1da291e46403c408e220bed6e1 ["y"] - -- !sql -- 2017-01-01 021603e7dcfe65d44af0efd0e5aee154 ["n"] 2017-01-01 48a33ec3453a28bce84b8f96fe161956 ["m"] @@ -739,8 +1039,11 @@ 2017-01-01 8fcb57ae675f0af4d613d9e6c0e8a2a8 [] 2017-01-01 9fcb57ae675f0af4d613d9e6c0e8a2a2 ["o"] 2017-01-01 d93d942d985a8fb7547c72dada8d332d ["d", "e", "f", "g", "h", "i", "j", "k", "l"] + +-- !sql -- 2019-01-01 0974e7a82e30d1af83205e474fadd0a2 ["w"] 2019-01-01 26823b3995ee38bd145ddd910b2f6300 ["x"] +2019-01-01 a648a447b8f71522f11632eba4b4adde ["p", "q", "r", "s", "t"] 2019-01-01 a9fb5c985c90bf05f3bee5ca3ae95260 ["u", "v"] 2019-01-01 ee27ee1da291e46403c408e220bed6e1 ["y"] diff --git a/regression-test/suites/inverted_index_p0/test_array_contains_with_inverted_index.groovy b/regression-test/suites/inverted_index_p0/test_array_contains_with_inverted_index.groovy index a18b6c4a23d45a..7aacf6e45a3b24 100644 --- a/regression-test/suites/inverted_index_p0/test_array_contains_with_inverted_index.groovy +++ b/regression-test/suites/inverted_index_p0/test_array_contains_with_inverted_index.groovy @@ -87,14 +87,23 @@ suite("test_array_contains_with_inverted_index"){ for (i = 0 ; i < param.size(); ++i) { def p = param[i] log.info("param: ${p}") - order_qt_sql """ select * from tai where arrays_overlap(inventors, ${p}) order by id; """ - order_qt_sql """ select * from tai where arrays_overlap(inventors, ${p}) and apply_date = '2017-01-01' order by id; """ - order_qt_sql """ select * from tai where arrays_overlap(inventors, ${p}) and apply_date = '2019-01-01' order by id; """ - order_qt_sql """ select * from tai where arrays_overlap(inventors, ${p}) or apply_date = '2017-01-01' order by id; """ - order_qt_sql """ select * from tai where !arrays_overlap(inventors, ${p}) order by id; """ - order_qt_sql """ select * from tai where !arrays_overlap(inventors, ${p}) and apply_date = '2017-01-01' order by id; """ - order_qt_sql """ select * from tai where !arrays_overlap(inventors, ${p}) and apply_date = '2019-01-01' order by id; """ - order_qt_sql """ select * from tai where !arrays_overlap(inventors, ${p}) or apply_date = '2017-01-01' order by id; """ - order_qt_sql """ select * from tai where (arrays_overlap(inventors, ${p}) and apply_date = '2017-01-01') or apply_date = '2019-01-01' order by id; """ + order_qt_sql """ select /*+SET_VAR(enable_common_expr_pushdown = true)*/ * from tai where arrays_overlap(inventors, ${p}) order by id; """ + order_qt_sql """ select /*+SET_VAR(enable_common_expr_pushdown = false)*/ * from tai where arrays_overlap(inventors, ${p}) order by id; """ + order_qt_sql """ select /*+SET_VAR(enable_common_expr_pushdown = true)*/ * from tai where arrays_overlap(inventors, ${p}) and apply_date = '2017-01-01' order by id; """ + order_qt_sql """ select /*+SET_VAR(enable_common_expr_pushdown = false)*/ * from tai where arrays_overlap(inventors, ${p}) and apply_date = '2017-01-01' order by id; """ + order_qt_sql """ select /*+SET_VAR(enable_common_expr_pushdown = true)*/ * from tai where arrays_overlap(inventors, ${p}) and apply_date = '2019-01-01' order by id; """ + order_qt_sql """ select /*+SET_VAR(enable_common_expr_pushdown = false)*/ * from tai where arrays_overlap(inventors, ${p}) and apply_date = '2019-01-01' order by id; """ + order_qt_sql """ select /*+SET_VAR(enable_common_expr_pushdown = true)*/ * from tai where arrays_overlap(inventors, ${p}) or apply_date = '2017-01-01' order by id; """ + order_qt_sql """ select /*+SET_VAR(enable_common_expr_pushdown = false)*/ * from tai where arrays_overlap(inventors, ${p}) or apply_date = '2017-01-01' order by id; """ + order_qt_sql """ select /*+SET_VAR(enable_common_expr_pushdown = true)*/ * from tai where !arrays_overlap(inventors, ${p}) order by id; """ + order_qt_sql """ select /*+SET_VAR(enable_common_expr_pushdown = false)*/ * from tai where !arrays_overlap(inventors, ${p}) order by id; """ + order_qt_sql """ select /*+SET_VAR(enable_common_expr_pushdown = true)*/ * from tai where !arrays_overlap(inventors, ${p}) and apply_date = '2017-01-01' order by id; """ + order_qt_sql """ select /*+SET_VAR(enable_common_expr_pushdown = false)*/ * from tai where !arrays_overlap(inventors, ${p}) and apply_date = '2017-01-01' order by id; """ + order_qt_sql """ select /*+SET_VAR(enable_common_expr_pushdown = true)*/ * from tai where !arrays_overlap(inventors, ${p}) and apply_date = '2019-01-01' order by id; """ + order_qt_sql """ select /*+SET_VAR(enable_common_expr_pushdown = false)*/ * from tai where !arrays_overlap(inventors, ${p}) and apply_date = '2019-01-01' order by id; """ + order_qt_sql """ select /*+SET_VAR(enable_common_expr_pushdown = true)*/ * from tai where !arrays_overlap(inventors, ${p}) or apply_date = '2017-01-01' order by id; """ + order_qt_sql """ select /*+SET_VAR(enable_common_expr_pushdown = false)*/ * from tai where !arrays_overlap(inventors, ${p}) or apply_date = '2017-01-01' order by id; """ + order_qt_sql """ select /*+SET_VAR(enable_common_expr_pushdown = true)*/ * from tai where (arrays_overlap(inventors, ${p}) and apply_date = '2017-01-01') or apply_date = '2019-01-01' order by id; """ + order_qt_sql """ select /*+SET_VAR(enable_common_expr_pushdown = false)*/ * from tai where (arrays_overlap(inventors, ${p}) and apply_date = '2017-01-01') or apply_date = '2019-01-01' order by id; """ } }