diff --git a/dwio/nimble/velox/RawSizeUtils.cpp b/dwio/nimble/velox/RawSizeUtils.cpp index 0add81e..cd66f22 100644 --- a/dwio/nimble/velox/RawSizeUtils.cpp +++ b/dwio/nimble/velox/RawSizeUtils.cpp @@ -23,65 +23,41 @@ namespace facebook::nimble { -template +template uint64_t getRawSizeFromFixedWidthVector( const velox::VectorPtr& vector, const velox::common::Ranges& ranges) { VELOX_CHECK_NOT_NULL(vector); VELOX_DCHECK( - (std::disjunction_v< - std::is_same, - std::is_same, - std::is_same, - std::is_same, - std::is_same, - std::is_same, - std::is_same>), - "Wrong vector type. Expected bool | int8_t | int16_t | int32_t | int64_t | float | double."); + K == velox::TypeKind::BOOLEAN || K == velox::TypeKind::TINYINT || + K == velox::TypeKind::SMALLINT || K == velox::TypeKind::INTEGER || + K == velox::TypeKind::BIGINT || K == velox::TypeKind::REAL || + K == velox::TypeKind::DOUBLE || K == velox::TypeKind::TIMESTAMP, + "Wrong vector type. Expected BOOLEAN | TINYINT | SMALLINT | INTEGER | BIGINT | REAL | DOUBLE | TIMESTAMP."); const auto& encoding = vector->encoding(); switch (encoding) { case velox::VectorEncoding::Simple::FLAT: { - const auto* flatVector = vector->asFlatVector(); - VELOX_CHECK_NOT_NULL( - flatVector, - "Encoding mismatch on FlatVector. Encoding: {}. TypeKind: {}.", - encoding, - vector->typeKind()); - uint64_t nullCount = 0; - if (flatVector->mayHaveNulls()) { + if (vector->mayHaveNulls()) { for (const auto& row : ranges) { - if (flatVector->isNullAt(row)) { + if (vector->isNullAt(row)) { ++nullCount; } } } - return ((ranges.size() - nullCount) * sizeof(T)) + + return ((ranges.size() - nullCount) * vector->type()->cppSizeInBytes()) + (nullCount * NULL_SIZE); } case velox::VectorEncoding::Simple::CONSTANT: { - const auto* constVector = vector->as>(); - VELOX_CHECK_NOT_NULL( - constVector, - "Encoding mismatch on ConstantVector. Encoding: {}. TypeKind: {}.", - encoding, - vector->typeKind()); - - return constVector->mayHaveNulls() ? ranges.size() * NULL_SIZE - : ranges.size() * sizeof(T); + return vector->mayHaveNulls() + ? ranges.size() * NULL_SIZE + : ranges.size() * vector->type()->cppSizeInBytes(); } case velox::VectorEncoding::Simple::DICTIONARY: { - const auto* dictVector = vector->as>(); - VELOX_CHECK_NOT_NULL( - dictVector, - "Encoding mismatch on DictionaryVector. Encoding: {}. TypeKind: {}.", - encoding, - vector->typeKind()); - // TODO: Optimize use of DecodedVector. - velox::DecodedVector decodedVector(*dictVector); + velox::DecodedVector decodedVector(*vector); uint64_t nullCount = 0; if (decodedVector.mayHaveNulls()) { @@ -92,7 +68,7 @@ uint64_t getRawSizeFromFixedWidthVector( } } - return ((ranges.size() - nullCount) * sizeof(T)) + + return ((ranges.size() - nullCount) * vector->type()->cppSizeInBytes()) + (nullCount * NULL_SIZE); } default: { @@ -532,25 +508,36 @@ uint64_t getRawSizeFromVector( const auto& typeKind = vector->typeKind(); switch (typeKind) { case velox::TypeKind::BOOLEAN: { - return getRawSizeFromFixedWidthVector(vector, ranges); + return getRawSizeFromFixedWidthVector( + vector, ranges); } case velox::TypeKind::TINYINT: { - return getRawSizeFromFixedWidthVector(vector, ranges); + return getRawSizeFromFixedWidthVector( + vector, ranges); } case velox::TypeKind::SMALLINT: { - return getRawSizeFromFixedWidthVector(vector, ranges); + return getRawSizeFromFixedWidthVector( + vector, ranges); } case velox::TypeKind::INTEGER: { - return getRawSizeFromFixedWidthVector(vector, ranges); + return getRawSizeFromFixedWidthVector( + vector, ranges); } case velox::TypeKind::BIGINT: { - return getRawSizeFromFixedWidthVector(vector, ranges); + return getRawSizeFromFixedWidthVector( + vector, ranges); } case velox::TypeKind::REAL: { - return getRawSizeFromFixedWidthVector(vector, ranges); + return getRawSizeFromFixedWidthVector( + vector, ranges); } case velox::TypeKind::DOUBLE: { - return getRawSizeFromFixedWidthVector(vector, ranges); + return getRawSizeFromFixedWidthVector( + vector, ranges); + } + case velox::TypeKind::TIMESTAMP: { + return getRawSizeFromFixedWidthVector( + vector, ranges); } case velox::TypeKind::VARCHAR: case velox::TypeKind::VARBINARY: { diff --git a/dwio/nimble/velox/tests/RawSizeTests.cpp b/dwio/nimble/velox/tests/RawSizeTests.cpp index cb58540..88c8f80 100644 --- a/dwio/nimble/velox/tests/RawSizeTests.cpp +++ b/dwio/nimble/velox/tests/RawSizeTests.cpp @@ -45,7 +45,6 @@ uint64_t getSize(T /*value*/) { return sizeof(T); } -// Specialization for StringView type template <> velox::StringView getValue(velox::vector_size_t /*i*/) { static std::shared_ptr str = @@ -53,12 +52,24 @@ velox::StringView getValue(velox::vector_size_t /*i*/) { return velox::StringView(str->data(), str->size()); } -// Specialization for StringView type template <> uint64_t getSize(velox::StringView value) { return value.size(); } +template <> +velox::Timestamp getValue(velox::vector_size_t /*i*/) { + int64_t seconds = folly::Random::rand32() % 1'000'000'000; + uint64_t nanos = folly::Random::rand32() % 1'000'000'000; + + return velox::Timestamp(seconds, nanos); +} + +template <> +uint64_t getSize(velox::Timestamp /*value*/) { + return sizeof(int64_t) + sizeof(uint64_t); +} + class RawSizeBaseTestFixture : public ::testing::Test { protected: static void SetUpTestSuite() { @@ -397,6 +408,88 @@ class RawSizeTestFixture : public RawSizeBaseTestFixture { } }; +// Macros to loop over each type +#define FOR_EACH_TYPE(MACRO) \ + MACRO(bool) \ + MACRO(int8_t) \ + MACRO(int16_t) \ + MACRO(int32_t) \ + MACRO(int64_t) \ + MACRO(float) \ + MACRO(double) \ + MACRO(velox::StringView) \ + MACRO(velox::Timestamp) + +#define TEST_FLAT(TYPE) \ + testFlat([](velox::vector_size_t) { return false; }); + +#define TEST_FLAT_SOME_NULL(TYPE) \ + testFlat(randomNulls(folly::Random::rand32() % 10 + 1)); + +#define TEST_CONSTANT(TYPE) \ + testConstant([](velox::vector_size_t) { return false; }); + +#define TEST_CONSTANT_SOME_NULL(TYPE) \ + testConstant(randomNulls(folly::Random::rand32() % 10 + 1)); + +#define TEST_DICTIONARY(TYPE) \ + testDictionary([](velox::vector_size_t) { return false; }); + +#define TEST_DICTIONARY_SOME_NULL(TYPE) \ + testDictionary(randomNulls(folly::Random::rand32() % 10 + 1)); + +#define TEST_ARRAY(TYPE) \ + testArray([](velox::vector_size_t) { return false; }); + +#define TEST_ARRAY_SOME_NULL(TYPE) \ + testArray(randomNulls(folly::Random::rand32() % 10 + 1)); + +#define TEST_CONSTANT_ARRAY(TYPE) \ + testConstantArray([](velox::vector_size_t) { return false; }); + +#define TEST_CONSTANT_ARRAY_SOME_NULL(TYPE) \ + testConstantArray(randomNulls(folly::Random::rand32() % 10 + 1)); + +#define TEST_DICTIONARY_ARRAY(TYPE) \ + testDictionaryArray([](velox::vector_size_t) { return false; }); + +#define TEST_DICTIONARY_ARRAY_SOME_NULL(TYPE) \ + testDictionaryArray(randomNulls(folly::Random::rand32() % 10 + 1)); + +// Macros to loop over each type for map values against user provided map key +#define FOR_EACH_VALUE_TYPE(KEY_TYPE, MACRO) \ + MACRO(KEY_TYPE, bool) \ + MACRO(KEY_TYPE, int8_t) \ + MACRO(KEY_TYPE, int16_t) \ + MACRO(KEY_TYPE, int32_t) \ + MACRO(KEY_TYPE, int64_t) \ + MACRO(KEY_TYPE, float) \ + MACRO(KEY_TYPE, double) \ + MACRO(KEY_TYPE, velox::StringView) \ + MACRO(KEY_TYPE, velox::Timestamp) + +#define TEST_MAP(KEY_TYPE, VALUE_TYPE) \ + testMap([](velox::vector_size_t) { return false; }); + +#define TEST_MAP_SOME_NULL(KEY_TYPE, VALUE_TYPE) \ + testMap(randomNulls(folly::Random::rand32() % 10 + 1)); + +#define TEST_CONSTANT_MAP(KEY_TYPE, VALUE_TYPE) \ + testConstantMap( \ + [](velox::vector_size_t) { return false; }); + +#define TEST_CONSTANT_MAP_SOME_NULL(KEY_TYPE, VALUE_TYPE) \ + testConstantMap( \ + randomNulls(folly::Random::rand32() % 10 + 1)); + +#define TEST_DICTIONARY_MAP(KEY_TYPE, VALUE_TYPE) \ + testDictionaryMap( \ + [](velox::vector_size_t) { return false; }); + +#define TEST_DICTIONARY_MAP_SOME_NULL(KEY_TYPE, VALUE_TYPE) \ + testDictionaryMap( \ + randomNulls(folly::Random::rand32() % 10 + 1)); + /* * The following tests are considered Fuzz tests. The data inside the vectors, * as well as the null count and positions, are randomized. The expected raw @@ -404,768 +497,117 @@ class RawSizeTestFixture : public RawSizeBaseTestFixture { * raw size returned by the function under test. */ TEST_F(RawSizeTestFixture, Flat) { - testFlat([](velox::vector_size_t) { return false; }); - testFlat([](velox::vector_size_t) { return false; }); - testFlat([](velox::vector_size_t) { return false; }); - testFlat([](velox::vector_size_t) { return false; }); - testFlat([](velox::vector_size_t) { return false; }); - testFlat([](velox::vector_size_t) { return false; }); - testFlat([](velox::vector_size_t) { return false; }); - testFlat([](velox::vector_size_t) { return false; }); + FOR_EACH_TYPE(TEST_FLAT); } + TEST_F(RawSizeTestFixture, FlatSomeNull) { - testFlat(randomNulls(folly::Random::rand32() % 10 + 1)); - testFlat(randomNulls(folly::Random::rand32() % 10 + 1)); - testFlat(randomNulls(folly::Random::rand32() % 10 + 1)); - testFlat(randomNulls(folly::Random::rand32() % 10 + 1)); - testFlat(randomNulls(folly::Random::rand32() % 10 + 1)); - testFlat(randomNulls(folly::Random::rand32() % 10 + 1)); - testFlat(randomNulls(folly::Random::rand32() % 10 + 1)); - testFlat(randomNulls(folly::Random::rand32() % 10 + 1)); + FOR_EACH_TYPE(TEST_FLAT_SOME_NULL); } TEST_F(RawSizeTestFixture, Constant) { - testConstant([](velox::vector_size_t) { return false; }); - testConstant([](velox::vector_size_t) { return false; }); - testConstant([](velox::vector_size_t) { return false; }); - testConstant([](velox::vector_size_t) { return false; }); - testConstant([](velox::vector_size_t) { return false; }); - testConstant([](velox::vector_size_t) { return false; }); - testConstant([](velox::vector_size_t) { return false; }); - testConstant([](velox::vector_size_t) { return false; }); + FOR_EACH_TYPE(TEST_CONSTANT); } TEST_F(RawSizeTestFixture, ConstantSomeNull) { - testConstant(randomNulls(folly::Random::rand32() % 10 + 1)); - testConstant(randomNulls(folly::Random::rand32() % 10 + 1)); - testConstant(randomNulls(folly::Random::rand32() % 10 + 1)); - testConstant(randomNulls(folly::Random::rand32() % 10 + 1)); - testConstant(randomNulls(folly::Random::rand32() % 10 + 1)); - testConstant(randomNulls(folly::Random::rand32() % 10 + 1)); - testConstant(randomNulls(folly::Random::rand32() % 10 + 1)); - testConstant( - randomNulls(folly::Random::rand32() % 10 + 1)); + FOR_EACH_TYPE(TEST_CONSTANT_SOME_NULL); } TEST_F(RawSizeTestFixture, Dictionary) { - testDictionary([](velox::vector_size_t) { return false; }); - testDictionary([](velox::vector_size_t) { return false; }); - testDictionary([](velox::vector_size_t) { return false; }); - testDictionary([](velox::vector_size_t) { return false; }); - testDictionary([](velox::vector_size_t) { return false; }); - testDictionary([](velox::vector_size_t) { return false; }); - testDictionary([](velox::vector_size_t) { return false; }); - testDictionary([](velox::vector_size_t) { return false; }); + FOR_EACH_TYPE(TEST_DICTIONARY); } TEST_F(RawSizeTestFixture, DictionarySomeNull) { - testDictionary(randomNulls(folly::Random::rand32() % 10 + 1)); - testDictionary(randomNulls(folly::Random::rand32() % 10 + 1)); - testDictionary(randomNulls(folly::Random::rand32() % 10 + 1)); - testDictionary(randomNulls(folly::Random::rand32() % 10 + 1)); - testDictionary(randomNulls(folly::Random::rand32() % 10 + 1)); - testDictionary(randomNulls(folly::Random::rand32() % 10 + 1)); - testDictionary(randomNulls(folly::Random::rand32() % 10 + 1)); - testDictionary( - randomNulls(folly::Random::rand32() % 10 + 1)); + FOR_EACH_TYPE(TEST_DICTIONARY_SOME_NULL); } TEST_F(RawSizeTestFixture, Array) { - testArray([](velox::vector_size_t) { return false; }); - testArray([](velox::vector_size_t) { return false; }); - testArray([](velox::vector_size_t) { return false; }); - testArray([](velox::vector_size_t) { return false; }); - testArray([](velox::vector_size_t) { return false; }); - testArray([](velox::vector_size_t) { return false; }); - testArray([](velox::vector_size_t) { return false; }); - testArray([](velox::vector_size_t) { return false; }); + FOR_EACH_TYPE(TEST_ARRAY); } -TEST_F(RawSizeTestFixture, ArraySomNull) { - testArray(randomNulls(folly::Random::rand32() % 10 + 1)); - testArray(randomNulls(folly::Random::rand32() % 10 + 1)); - testArray(randomNulls(folly::Random::rand32() % 10 + 1)); - testArray(randomNulls(folly::Random::rand32() % 10 + 1)); - testArray(randomNulls(folly::Random::rand32() % 10 + 1)); - testArray(randomNulls(folly::Random::rand32() % 10 + 1)); - testArray(randomNulls(folly::Random::rand32() % 10 + 1)); - testArray(randomNulls(folly::Random::rand32() % 10 + 1)); +TEST_F(RawSizeTestFixture, ArraySomeNull) { + FOR_EACH_TYPE(TEST_ARRAY_SOME_NULL); } TEST_F(RawSizeTestFixture, ConstantArray) { - testConstantArray([](velox::vector_size_t) { return false; }); - testConstantArray([](velox::vector_size_t) { return false; }); - testConstantArray([](velox::vector_size_t) { return false; }); - testConstantArray([](velox::vector_size_t) { return false; }); - testConstantArray([](velox::vector_size_t) { return false; }); - testConstantArray([](velox::vector_size_t) { return false; }); - testConstantArray([](velox::vector_size_t) { return false; }); - testConstantArray( - [](velox::vector_size_t) { return false; }); + FOR_EACH_TYPE(TEST_CONSTANT_ARRAY); } TEST_F(RawSizeTestFixture, ConstantArraySomeNull) { - testConstantArray(randomNulls(folly::Random::rand32() % 10 + 1)); - testConstantArray(randomNulls(folly::Random::rand32() % 10 + 1)); - testConstantArray(randomNulls(folly::Random::rand32() % 10 + 1)); - testConstantArray(randomNulls(folly::Random::rand32() % 10 + 1)); - testConstantArray(randomNulls(folly::Random::rand32() % 10 + 1)); - testConstantArray(randomNulls(folly::Random::rand32() % 10 + 1)); - testConstantArray(randomNulls(folly::Random::rand32() % 10 + 1)); - testConstantArray( - randomNulls(folly::Random::rand32() % 10 + 1)); + FOR_EACH_TYPE(TEST_CONSTANT_ARRAY_SOME_NULL); } TEST_F(RawSizeTestFixture, DictionaryArray) { - testDictionaryArray([](velox::vector_size_t) { return false; }); - testDictionaryArray([](velox::vector_size_t) { return false; }); - testDictionaryArray([](velox::vector_size_t) { return false; }); - testDictionaryArray([](velox::vector_size_t) { return false; }); - testDictionaryArray([](velox::vector_size_t) { return false; }); - testDictionaryArray([](velox::vector_size_t) { return false; }); - testDictionaryArray([](velox::vector_size_t) { return false; }); - testDictionaryArray( - [](velox::vector_size_t) { return false; }); + FOR_EACH_TYPE(TEST_DICTIONARY_ARRAY); } TEST_F(RawSizeTestFixture, DictionaryArraySomeNull) { - testDictionaryArray(randomNulls(folly::Random::rand32() % 10 + 1)); - testDictionaryArray(randomNulls(folly::Random::rand32() % 10 + 1)); - testDictionaryArray(randomNulls(folly::Random::rand32() % 10 + 1)); - testDictionaryArray(randomNulls(folly::Random::rand32() % 10 + 1)); - testDictionaryArray(randomNulls(folly::Random::rand32() % 10 + 1)); - testDictionaryArray(randomNulls(folly::Random::rand32() % 10 + 1)); - testDictionaryArray(randomNulls(folly::Random::rand32() % 10 + 1)); - testDictionaryArray( - randomNulls(folly::Random::rand32() % 10 + 1)); + FOR_EACH_TYPE(TEST_DICTIONARY_ARRAY_SOME_NULL); } TEST_F(RawSizeTestFixture, Map) { - testMap([](velox::vector_size_t) { return false; }); - testMap([](velox::vector_size_t) { return false; }); - testMap([](velox::vector_size_t) { return false; }); - testMap([](velox::vector_size_t) { return false; }); - testMap([](velox::vector_size_t) { return false; }); - testMap([](velox::vector_size_t) { return false; }); - testMap([](velox::vector_size_t) { return false; }); - testMap([](velox::vector_size_t) { return false; }); - - testMap([](velox::vector_size_t) { return false; }); - testMap([](velox::vector_size_t) { return false; }); - testMap([](velox::vector_size_t) { return false; }); - testMap([](velox::vector_size_t) { return false; }); - testMap([](velox::vector_size_t) { return false; }); - testMap([](velox::vector_size_t) { return false; }); - testMap([](velox::vector_size_t) { return false; }); - testMap( - [](velox::vector_size_t) { return false; }); - - testMap([](velox::vector_size_t) { return false; }); - testMap([](velox::vector_size_t) { return false; }); - testMap([](velox::vector_size_t) { return false; }); - testMap([](velox::vector_size_t) { return false; }); - testMap([](velox::vector_size_t) { return false; }); - testMap([](velox::vector_size_t) { return false; }); - testMap([](velox::vector_size_t) { return false; }); - testMap( - [](velox::vector_size_t) { return false; }); - - testMap([](velox::vector_size_t) { return false; }); - testMap([](velox::vector_size_t) { return false; }); - testMap([](velox::vector_size_t) { return false; }); - testMap([](velox::vector_size_t) { return false; }); - testMap([](velox::vector_size_t) { return false; }); - testMap([](velox::vector_size_t) { return false; }); - testMap([](velox::vector_size_t) { return false; }); - testMap( - [](velox::vector_size_t) { return false; }); - - testMap([](velox::vector_size_t) { return false; }); - testMap([](velox::vector_size_t) { return false; }); - testMap([](velox::vector_size_t) { return false; }); - testMap([](velox::vector_size_t) { return false; }); - testMap([](velox::vector_size_t) { return false; }); - testMap([](velox::vector_size_t) { return false; }); - testMap([](velox::vector_size_t) { return false; }); - testMap( - [](velox::vector_size_t) { return false; }); - - testMap([](velox::vector_size_t) { return false; }); - testMap([](velox::vector_size_t) { return false; }); - testMap([](velox::vector_size_t) { return false; }); - testMap([](velox::vector_size_t) { return false; }); - testMap([](velox::vector_size_t) { return false; }); - testMap([](velox::vector_size_t) { return false; }); - testMap([](velox::vector_size_t) { return false; }); - testMap([](velox::vector_size_t) { return false; }); - - testMap([](velox::vector_size_t) { return false; }); - testMap([](velox::vector_size_t) { return false; }); - testMap([](velox::vector_size_t) { return false; }); - testMap([](velox::vector_size_t) { return false; }); - testMap([](velox::vector_size_t) { return false; }); - testMap([](velox::vector_size_t) { return false; }); - testMap([](velox::vector_size_t) { return false; }); - testMap( - [](velox::vector_size_t) { return false; }); - - testMap([](velox::vector_size_t) { return false; }); - testMap( - [](velox::vector_size_t) { return false; }); - testMap( - [](velox::vector_size_t) { return false; }); - testMap( - [](velox::vector_size_t) { return false; }); - testMap( - [](velox::vector_size_t) { return false; }); - testMap([](velox::vector_size_t) { return false; }); - testMap( - [](velox::vector_size_t) { return false; }); - testMap( - [](velox::vector_size_t) { return false; }); + FOR_EACH_VALUE_TYPE(int8_t, TEST_MAP); + FOR_EACH_VALUE_TYPE(int16_t, TEST_MAP); + FOR_EACH_VALUE_TYPE(int32_t, TEST_MAP); + FOR_EACH_VALUE_TYPE(int64_t, TEST_MAP); + FOR_EACH_VALUE_TYPE(float, TEST_MAP); + FOR_EACH_VALUE_TYPE(double, TEST_MAP); + FOR_EACH_VALUE_TYPE(velox::StringView, TEST_MAP); + FOR_EACH_VALUE_TYPE(velox::Timestamp, TEST_MAP); } TEST_F(RawSizeTestFixture, MapSomeNull) { - testMap(randomNulls(folly::Random::rand32() % 10 + 1)); - testMap(randomNulls(folly::Random::rand32() % 10 + 1)); - testMap(randomNulls(folly::Random::rand32() % 10 + 1)); - testMap(randomNulls(folly::Random::rand32() % 10 + 1)); - testMap(randomNulls(folly::Random::rand32() % 10 + 1)); - testMap(randomNulls(folly::Random::rand32() % 10 + 1)); - testMap(randomNulls(folly::Random::rand32() % 10 + 1)); - testMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - - testMap(randomNulls(folly::Random::rand32() % 10 + 1)); - testMap(randomNulls(folly::Random::rand32() % 10 + 1)); - testMap(randomNulls(folly::Random::rand32() % 10 + 1)); - testMap(randomNulls(folly::Random::rand32() % 10 + 1)); - testMap(randomNulls(folly::Random::rand32() % 10 + 1)); - testMap(randomNulls(folly::Random::rand32() % 10 + 1)); - testMap(randomNulls(folly::Random::rand32() % 10 + 1)); - testMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - - testMap(randomNulls(folly::Random::rand32() % 10 + 1)); - testMap(randomNulls(folly::Random::rand32() % 10 + 1)); - testMap(randomNulls(folly::Random::rand32() % 10 + 1)); - testMap(randomNulls(folly::Random::rand32() % 10 + 1)); - testMap(randomNulls(folly::Random::rand32() % 10 + 1)); - testMap(randomNulls(folly::Random::rand32() % 10 + 1)); - testMap(randomNulls(folly::Random::rand32() % 10 + 1)); - testMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - - testMap(randomNulls(folly::Random::rand32() % 10 + 1)); - testMap(randomNulls(folly::Random::rand32() % 10 + 1)); - testMap(randomNulls(folly::Random::rand32() % 10 + 1)); - testMap(randomNulls(folly::Random::rand32() % 10 + 1)); - testMap(randomNulls(folly::Random::rand32() % 10 + 1)); - testMap(randomNulls(folly::Random::rand32() % 10 + 1)); - testMap(randomNulls(folly::Random::rand32() % 10 + 1)); - testMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - - testMap(randomNulls(folly::Random::rand32() % 10 + 1)); - testMap(randomNulls(folly::Random::rand32() % 10 + 1)); - testMap(randomNulls(folly::Random::rand32() % 10 + 1)); - testMap(randomNulls(folly::Random::rand32() % 10 + 1)); - testMap(randomNulls(folly::Random::rand32() % 10 + 1)); - testMap(randomNulls(folly::Random::rand32() % 10 + 1)); - testMap(randomNulls(folly::Random::rand32() % 10 + 1)); - testMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - - testMap(randomNulls(folly::Random::rand32() % 10 + 1)); - testMap(randomNulls(folly::Random::rand32() % 10 + 1)); - testMap(randomNulls(folly::Random::rand32() % 10 + 1)); - testMap(randomNulls(folly::Random::rand32() % 10 + 1)); - testMap(randomNulls(folly::Random::rand32() % 10 + 1)); - testMap(randomNulls(folly::Random::rand32() % 10 + 1)); - testMap(randomNulls(folly::Random::rand32() % 10 + 1)); - testMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - - testMap(randomNulls(folly::Random::rand32() % 10 + 1)); - testMap(randomNulls(folly::Random::rand32() % 10 + 1)); - testMap(randomNulls(folly::Random::rand32() % 10 + 1)); - testMap(randomNulls(folly::Random::rand32() % 10 + 1)); - testMap(randomNulls(folly::Random::rand32() % 10 + 1)); - testMap(randomNulls(folly::Random::rand32() % 10 + 1)); - testMap(randomNulls(folly::Random::rand32() % 10 + 1)); - testMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - - testMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testMap( - randomNulls(folly::Random::rand32() % 10 + 1)); + FOR_EACH_VALUE_TYPE(int8_t, TEST_MAP_SOME_NULL); + FOR_EACH_VALUE_TYPE(int16_t, TEST_MAP_SOME_NULL); + FOR_EACH_VALUE_TYPE(int32_t, TEST_MAP_SOME_NULL); + FOR_EACH_VALUE_TYPE(int64_t, TEST_MAP_SOME_NULL); + FOR_EACH_VALUE_TYPE(float, TEST_MAP_SOME_NULL); + FOR_EACH_VALUE_TYPE(double, TEST_MAP_SOME_NULL); + FOR_EACH_VALUE_TYPE(velox::StringView, TEST_MAP_SOME_NULL); + FOR_EACH_VALUE_TYPE(velox::Timestamp, TEST_MAP_SOME_NULL); } TEST_F(RawSizeTestFixture, ConstantMap) { - testConstantMap([](velox::vector_size_t) { return false; }); - testConstantMap([](velox::vector_size_t) { return false; }); - testConstantMap([](velox::vector_size_t) { return false; }); - testConstantMap([](velox::vector_size_t) { return false; }); - testConstantMap([](velox::vector_size_t) { return false; }); - testConstantMap([](velox::vector_size_t) { return false; }); - testConstantMap([](velox::vector_size_t) { return false; }); - testConstantMap( - [](velox::vector_size_t) { return false; }); - - testConstantMap([](velox::vector_size_t) { return false; }); - testConstantMap([](velox::vector_size_t) { return false; }); - testConstantMap([](velox::vector_size_t) { return false; }); - testConstantMap([](velox::vector_size_t) { return false; }); - testConstantMap([](velox::vector_size_t) { return false; }); - testConstantMap([](velox::vector_size_t) { return false; }); - testConstantMap([](velox::vector_size_t) { return false; }); - testConstantMap( - [](velox::vector_size_t) { return false; }); - - testConstantMap([](velox::vector_size_t) { return false; }); - testConstantMap([](velox::vector_size_t) { return false; }); - testConstantMap([](velox::vector_size_t) { return false; }); - testConstantMap([](velox::vector_size_t) { return false; }); - testConstantMap([](velox::vector_size_t) { return false; }); - testConstantMap([](velox::vector_size_t) { return false; }); - testConstantMap([](velox::vector_size_t) { return false; }); - testConstantMap( - [](velox::vector_size_t) { return false; }); - - testConstantMap([](velox::vector_size_t) { return false; }); - testConstantMap([](velox::vector_size_t) { return false; }); - testConstantMap([](velox::vector_size_t) { return false; }); - testConstantMap([](velox::vector_size_t) { return false; }); - testConstantMap([](velox::vector_size_t) { return false; }); - testConstantMap([](velox::vector_size_t) { return false; }); - testConstantMap([](velox::vector_size_t) { return false; }); - testConstantMap( - [](velox::vector_size_t) { return false; }); - - testConstantMap([](velox::vector_size_t) { return false; }); - testConstantMap([](velox::vector_size_t) { return false; }); - testConstantMap([](velox::vector_size_t) { return false; }); - testConstantMap([](velox::vector_size_t) { return false; }); - testConstantMap([](velox::vector_size_t) { return false; }); - testConstantMap([](velox::vector_size_t) { return false; }); - testConstantMap([](velox::vector_size_t) { return false; }); - testConstantMap( - [](velox::vector_size_t) { return false; }); - - testConstantMap([](velox::vector_size_t) { return false; }); - testConstantMap([](velox::vector_size_t) { return false; }); - testConstantMap([](velox::vector_size_t) { return false; }); - testConstantMap([](velox::vector_size_t) { return false; }); - testConstantMap([](velox::vector_size_t) { return false; }); - testConstantMap([](velox::vector_size_t) { return false; }); - testConstantMap([](velox::vector_size_t) { return false; }); - testConstantMap( - [](velox::vector_size_t) { return false; }); - - testConstantMap([](velox::vector_size_t) { return false; }); - testConstantMap([](velox::vector_size_t) { return false; }); - testConstantMap([](velox::vector_size_t) { return false; }); - testConstantMap([](velox::vector_size_t) { return false; }); - testConstantMap([](velox::vector_size_t) { return false; }); - testConstantMap([](velox::vector_size_t) { return false; }); - testConstantMap([](velox::vector_size_t) { return false; }); - testConstantMap( - [](velox::vector_size_t) { return false; }); - - testConstantMap( - [](velox::vector_size_t) { return false; }); - testConstantMap( - [](velox::vector_size_t) { return false; }); - testConstantMap( - [](velox::vector_size_t) { return false; }); - testConstantMap( - [](velox::vector_size_t) { return false; }); - testConstantMap( - [](velox::vector_size_t) { return false; }); - testConstantMap( - [](velox::vector_size_t) { return false; }); - testConstantMap( - [](velox::vector_size_t) { return false; }); - testConstantMap( - [](velox::vector_size_t) { return false; }); + FOR_EACH_VALUE_TYPE(int8_t, TEST_CONSTANT_MAP); + FOR_EACH_VALUE_TYPE(int16_t, TEST_CONSTANT_MAP); + FOR_EACH_VALUE_TYPE(int32_t, TEST_CONSTANT_MAP); + FOR_EACH_VALUE_TYPE(int64_t, TEST_CONSTANT_MAP); + FOR_EACH_VALUE_TYPE(float, TEST_CONSTANT_MAP); + FOR_EACH_VALUE_TYPE(double, TEST_CONSTANT_MAP); + FOR_EACH_VALUE_TYPE(velox::StringView, TEST_CONSTANT_MAP); + FOR_EACH_VALUE_TYPE(velox::Timestamp, TEST_CONSTANT_MAP); } TEST_F(RawSizeTestFixture, ConstantMapSomeNull) { - testConstantMap(randomNulls(folly::Random::rand32() % 10 + 1)); - testConstantMap(randomNulls(folly::Random::rand32() % 10 + 1)); - testConstantMap(randomNulls(folly::Random::rand32() % 10 + 1)); - testConstantMap(randomNulls(folly::Random::rand32() % 10 + 1)); - testConstantMap(randomNulls(folly::Random::rand32() % 10 + 1)); - testConstantMap(randomNulls(folly::Random::rand32() % 10 + 1)); - testConstantMap(randomNulls(folly::Random::rand32() % 10 + 1)); - testConstantMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - - testConstantMap(randomNulls(folly::Random::rand32() % 10 + 1)); - testConstantMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testConstantMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testConstantMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testConstantMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testConstantMap(randomNulls(folly::Random::rand32() % 10 + 1)); - testConstantMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testConstantMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - - testConstantMap(randomNulls(folly::Random::rand32() % 10 + 1)); - testConstantMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testConstantMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testConstantMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testConstantMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testConstantMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testConstantMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testConstantMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - - testConstantMap(randomNulls(folly::Random::rand32() % 10 + 1)); - testConstantMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testConstantMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testConstantMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testConstantMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testConstantMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testConstantMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testConstantMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - - testConstantMap(randomNulls(folly::Random::rand32() % 10 + 1)); - testConstantMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testConstantMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testConstantMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testConstantMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testConstantMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testConstantMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testConstantMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - - testConstantMap(randomNulls(folly::Random::rand32() % 10 + 1)); - testConstantMap(randomNulls(folly::Random::rand32() % 10 + 1)); - testConstantMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testConstantMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testConstantMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testConstantMap(randomNulls(folly::Random::rand32() % 10 + 1)); - testConstantMap(randomNulls(folly::Random::rand32() % 10 + 1)); - testConstantMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - - testConstantMap(randomNulls(folly::Random::rand32() % 10 + 1)); - testConstantMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testConstantMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testConstantMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testConstantMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testConstantMap(randomNulls(folly::Random::rand32() % 10 + 1)); - testConstantMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testConstantMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - - testConstantMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testConstantMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testConstantMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testConstantMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testConstantMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testConstantMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testConstantMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testConstantMap( - randomNulls(folly::Random::rand32() % 10 + 1)); + FOR_EACH_VALUE_TYPE(int8_t, TEST_CONSTANT_MAP_SOME_NULL); + FOR_EACH_VALUE_TYPE(int16_t, TEST_CONSTANT_MAP_SOME_NULL); + FOR_EACH_VALUE_TYPE(int32_t, TEST_CONSTANT_MAP_SOME_NULL); + FOR_EACH_VALUE_TYPE(int64_t, TEST_CONSTANT_MAP_SOME_NULL); + FOR_EACH_VALUE_TYPE(float, TEST_CONSTANT_MAP_SOME_NULL); + FOR_EACH_VALUE_TYPE(double, TEST_CONSTANT_MAP_SOME_NULL); + FOR_EACH_VALUE_TYPE(velox::StringView, TEST_CONSTANT_MAP_SOME_NULL); + FOR_EACH_VALUE_TYPE(velox::Timestamp, TEST_CONSTANT_MAP_SOME_NULL); } TEST_F(RawSizeTestFixture, DictionaryMap) { - testDictionaryMap([](velox::vector_size_t) { return false; }); - testDictionaryMap([](velox::vector_size_t) { return false; }); - testDictionaryMap([](velox::vector_size_t) { return false; }); - testDictionaryMap([](velox::vector_size_t) { return false; }); - testDictionaryMap([](velox::vector_size_t) { return false; }); - testDictionaryMap([](velox::vector_size_t) { return false; }); - testDictionaryMap([](velox::vector_size_t) { return false; }); - testDictionaryMap( - [](velox::vector_size_t) { return false; }); - - testDictionaryMap([](velox::vector_size_t) { return false; }); - testDictionaryMap([](velox::vector_size_t) { return false; }); - testDictionaryMap( - [](velox::vector_size_t) { return false; }); - testDictionaryMap( - [](velox::vector_size_t) { return false; }); - testDictionaryMap( - [](velox::vector_size_t) { return false; }); - testDictionaryMap([](velox::vector_size_t) { return false; }); - testDictionaryMap([](velox::vector_size_t) { return false; }); - testDictionaryMap( - [](velox::vector_size_t) { return false; }); - - testDictionaryMap([](velox::vector_size_t) { return false; }); - testDictionaryMap( - [](velox::vector_size_t) { return false; }); - testDictionaryMap( - [](velox::vector_size_t) { return false; }); - testDictionaryMap( - [](velox::vector_size_t) { return false; }); - testDictionaryMap( - [](velox::vector_size_t) { return false; }); - testDictionaryMap([](velox::vector_size_t) { return false; }); - testDictionaryMap( - [](velox::vector_size_t) { return false; }); - testDictionaryMap( - [](velox::vector_size_t) { return false; }); - - testDictionaryMap([](velox::vector_size_t) { return false; }); - testDictionaryMap( - [](velox::vector_size_t) { return false; }); - testDictionaryMap( - [](velox::vector_size_t) { return false; }); - testDictionaryMap( - [](velox::vector_size_t) { return false; }); - testDictionaryMap( - [](velox::vector_size_t) { return false; }); - testDictionaryMap([](velox::vector_size_t) { return false; }); - testDictionaryMap( - [](velox::vector_size_t) { return false; }); - testDictionaryMap( - [](velox::vector_size_t) { return false; }); - - testDictionaryMap([](velox::vector_size_t) { return false; }); - testDictionaryMap( - [](velox::vector_size_t) { return false; }); - testDictionaryMap( - [](velox::vector_size_t) { return false; }); - testDictionaryMap( - [](velox::vector_size_t) { return false; }); - testDictionaryMap( - [](velox::vector_size_t) { return false; }); - testDictionaryMap([](velox::vector_size_t) { return false; }); - testDictionaryMap( - [](velox::vector_size_t) { return false; }); - testDictionaryMap( - [](velox::vector_size_t) { return false; }); - - testDictionaryMap([](velox::vector_size_t) { return false; }); - testDictionaryMap([](velox::vector_size_t) { return false; }); - testDictionaryMap([](velox::vector_size_t) { return false; }); - testDictionaryMap([](velox::vector_size_t) { return false; }); - testDictionaryMap([](velox::vector_size_t) { return false; }); - testDictionaryMap([](velox::vector_size_t) { return false; }); - testDictionaryMap([](velox::vector_size_t) { return false; }); - testDictionaryMap( - [](velox::vector_size_t) { return false; }); - - testDictionaryMap([](velox::vector_size_t) { return false; }); - testDictionaryMap([](velox::vector_size_t) { return false; }); - testDictionaryMap( - [](velox::vector_size_t) { return false; }); - testDictionaryMap( - [](velox::vector_size_t) { return false; }); - testDictionaryMap( - [](velox::vector_size_t) { return false; }); - testDictionaryMap([](velox::vector_size_t) { return false; }); - testDictionaryMap([](velox::vector_size_t) { return false; }); - testDictionaryMap( - [](velox::vector_size_t) { return false; }); - - testDictionaryMap( - [](velox::vector_size_t) { return false; }); - testDictionaryMap( - [](velox::vector_size_t) { return false; }); - testDictionaryMap( - [](velox::vector_size_t) { return false; }); - testDictionaryMap( - [](velox::vector_size_t) { return false; }); - testDictionaryMap( - [](velox::vector_size_t) { return false; }); - testDictionaryMap( - [](velox::vector_size_t) { return false; }); - testDictionaryMap( - [](velox::vector_size_t) { return false; }); - testDictionaryMap( - [](velox::vector_size_t) { return false; }); + FOR_EACH_VALUE_TYPE(int8_t, TEST_DICTIONARY_MAP); + FOR_EACH_VALUE_TYPE(int16_t, TEST_DICTIONARY_MAP); + FOR_EACH_VALUE_TYPE(int32_t, TEST_DICTIONARY_MAP); + FOR_EACH_VALUE_TYPE(int64_t, TEST_DICTIONARY_MAP); + FOR_EACH_VALUE_TYPE(float, TEST_DICTIONARY_MAP); + FOR_EACH_VALUE_TYPE(double, TEST_DICTIONARY_MAP); + FOR_EACH_VALUE_TYPE(velox::StringView, TEST_DICTIONARY_MAP); + FOR_EACH_VALUE_TYPE(velox::Timestamp, TEST_DICTIONARY_MAP); } TEST_F(RawSizeTestFixture, DictionaryMapSomeNull) { - testDictionaryMap(randomNulls(folly::Random::rand32() % 10 + 1)); - testDictionaryMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testDictionaryMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testDictionaryMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testDictionaryMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testDictionaryMap(randomNulls(folly::Random::rand32() % 10 + 1)); - testDictionaryMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testDictionaryMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - - testDictionaryMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testDictionaryMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testDictionaryMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testDictionaryMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testDictionaryMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testDictionaryMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testDictionaryMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testDictionaryMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - - testDictionaryMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testDictionaryMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testDictionaryMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testDictionaryMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testDictionaryMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testDictionaryMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testDictionaryMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testDictionaryMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - - testDictionaryMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testDictionaryMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testDictionaryMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testDictionaryMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testDictionaryMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testDictionaryMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testDictionaryMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testDictionaryMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - - testDictionaryMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testDictionaryMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testDictionaryMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testDictionaryMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testDictionaryMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testDictionaryMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testDictionaryMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testDictionaryMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - - testDictionaryMap(randomNulls(folly::Random::rand32() % 10 + 1)); - testDictionaryMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testDictionaryMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testDictionaryMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testDictionaryMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testDictionaryMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testDictionaryMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testDictionaryMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - - testDictionaryMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testDictionaryMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testDictionaryMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testDictionaryMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testDictionaryMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testDictionaryMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testDictionaryMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testDictionaryMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - - testDictionaryMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testDictionaryMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testDictionaryMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testDictionaryMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testDictionaryMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testDictionaryMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testDictionaryMap( - randomNulls(folly::Random::rand32() % 10 + 1)); - testDictionaryMap( - randomNulls(folly::Random::rand32() % 10 + 1)); + FOR_EACH_VALUE_TYPE(int8_t, TEST_DICTIONARY_MAP_SOME_NULL); + FOR_EACH_VALUE_TYPE(int16_t, TEST_DICTIONARY_MAP_SOME_NULL); + FOR_EACH_VALUE_TYPE(int32_t, TEST_DICTIONARY_MAP_SOME_NULL); + FOR_EACH_VALUE_TYPE(int64_t, TEST_DICTIONARY_MAP_SOME_NULL); + FOR_EACH_VALUE_TYPE(float, TEST_DICTIONARY_MAP_SOME_NULL); + FOR_EACH_VALUE_TYPE(double, TEST_DICTIONARY_MAP_SOME_NULL); + FOR_EACH_VALUE_TYPE(velox::StringView, TEST_DICTIONARY_MAP_SOME_NULL); + FOR_EACH_VALUE_TYPE(velox::Timestamp, TEST_DICTIONARY_MAP_SOME_NULL); } /*