facebookincubator / velox

A composable and fully extensible C++ execution engine library for data management systems.
https://velox-lib.io/
Apache License 2.0
3.52k stars 1.15k forks source link

Map keys cannot be null when opt.normalizeMapKeys is true #3046

Closed mbasmanova closed 1 year ago

mbasmanova commented 2 years ago
I1031 18:54:46.353041 1538033 ExpressionFuzzer.cpp:702] ==============================> Started iteration 3646 (seed: 434987544)
E1031 18:54:46.360759 1538033 Exceptions.h:68] Line: velox/vector/fuzzer/VectorFuzzer.cpp:577, Function:normalizeMapKeys, Expression: BaseVector::countNulls(nulls, 0, keys->size()) == 0 (
1000 vs. 0) Map keys cannot be null when opt.normalizeMapKeys is true, Source: RUNTIME, ErrorCode: INVALID_STATE
terminate called after throwing an instance of 'facebook::velox::VeloxRuntimeError'
  what():  Exception: VeloxRuntimeError
Error Source: RUNTIME
Error Code: INVALID_STATE
Reason: (1000 vs. 0) Map keys cannot be null when opt.normalizeMapKeys is true
Retriable: False
Expression: BaseVector::countNulls(nulls, 0, keys->size()) == 0
Function: normalizeMapKeys
File: velox/vector/fuzzer/VectorFuzzer.cpp
Line: 577
Stack trace:
# 0  std::shared_ptr<facebook::velox::VeloxException::State const> facebook::velox::VeloxException::State::make<facebook::velox::VeloxException::make(char const*, unsigned long, char const*, std::basic_string_view<char, std::char_traits<char> >, std::basic_string_view<char, std::char_traits<char> >, std::basic_string_view<char, std::char_traits<char> >, std::basic_string_view<char, std::char_traits<char> >, bool, facebook::velox::VeloxException::Type, std::basic_string_view<char, std::char_traits<char> >)::$_0>(facebook::velox::VeloxException::Type, facebook::velox::VeloxException::make(char const*, unsigned long, char const*, std::basic_string_view<char, std::char_traits<char> >, std::basic_string_view<char, std::char_traits<char> >, std::basic_string_view<char, std::char_traits<char> >, std::basic_string_view<char, std::char_traits<char> >, bool, facebook::velox::VeloxException::Type, std::basic_string_view<char, std::char_traits<char> >)::$_0)
# 1  facebook::velox::VeloxException::VeloxException(char const*, unsigned long, char const*, std::basic_string_view<char, std::char_traits<char> >, std::basic_string_view<char, std::char_traits<char> >, std::basic_string_view<char, std::char_traits<char> >, std::basic_string_view<char, std::char_traits<char> >, bool, facebook::velox::VeloxException::Type, std::basic_string_view<char, std::char_traits<char> >)
# 2  facebook::velox::VeloxRuntimeError::VeloxRuntimeError(char const*, unsigned long, char const*, std::basic_string_view<char, std::char_traits<char> >, std::basic_string_view<char, std::char_traits<char> >, std::basic_string_view<char, std::char_traits<char> >, std::basic_string_view<char, std::char_traits<char> >, bool, std::basic_string_view<char, std::char_traits<char> >)
# 3  void facebook::velox::detail::veloxCheckFail<facebook::velox::VeloxRuntimeError, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&>(facebook::velox::detail::VeloxCheckFailArgs const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
# 4  facebook::velox::VectorFuzzer::normalizeMapKeys(std::shared_ptr<facebook::velox::BaseVector> const&, unsigned long, boost::intrusive_ptr<facebook::velox::Buffer>&, boost::intrusive_ptr<facebook::velox::Buffer>&)
# 5  facebook::velox::VectorFuzzer::fuzzMap(std::shared_ptr<facebook::velox::BaseVector> const&, std::shared_ptr<facebook::velox::BaseVector> const&, int)
# 6  facebook::velox::VectorFuzzer::fuzzComplex(std::shared_ptr<facebook::velox::Type const> const&, int)
# 7  facebook::velox::VectorFuzzer::fuzz(std::shared_ptr<facebook::velox::Type const> const&, int)
# 8  facebook::velox::VectorFuzzer::fuzzRow(std::shared_ptr<facebook::velox::RowType const> const&, int)
# 9  facebook::velox::VectorFuzzer::fuzzRow(std::shared_ptr<facebook::velox::RowType const> const&)
# 10 facebook::velox::test::ExpressionFuzzer::generateRowVector()
# 11 facebook::velox::test::ExpressionFuzzer::go()

CC: @pedroerp

laithsakka commented 2 years ago

I am looking at this

laithsakka commented 2 years ago

start with : buck run //velox/expression/tests:velox_expression_fuzzer_test -- --velox_fuzzer_enable_complex_types keep adding functions to blacklist until repro happen

laithsakka commented 2 years ago

to repor : run buck run //velox/expression/tests:velox_expression_fuzzer_test -- --velox_fuzzer_enable_complex_types --seed=434987544

after updating skip list to include:

  // be fixed before we can enable.
  std::unordered_set<std::string> skipFunctions = {
      // Fuzzer and the underlying engine are confused about cardinality(HLL)
      // (since HLL is a user defined type), and end up trying to use
      // cardinality passing a VARBINARY (since HLL's implementation uses an
      // alias to VARBINARY).
      "cardinality",
      "neq",
      "in",
      "array_sort",
      "array_intersect",
      "map_concat_empty_nulls",
      "width_bucket"};
laithsakka commented 2 years ago

fix diff is up