File tree Expand file tree Collapse file tree 2 files changed +5
-7
lines changed
src/Functions/keyvaluepair/impl Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ class CHKeyValuePairExtractor : public KeyValuePairExtractor
3636 {
3737 auto state = State::WAITING_KEY;
3838
39- auto pair_writer = typename StateHandler::StringWriter (map);
39+ auto pair_writer = typename StateHandler::StringWriter (& map);
4040
4141 uint64_t row_offset = 0 ;
4242
Original file line number Diff line number Diff line change @@ -591,19 +591,17 @@ struct ReferencesOnlyStateHandler : public StateHandlerImpl<false>
591591 * */
592592 class StringWriter
593593 {
594- static inline absl::flat_hash_map<std::string_view, std::string_view> dummy_map;
595- absl::flat_hash_map<std::string_view, std::string_view> & map;
594+ absl::flat_hash_map<std::string_view, std::string_view> * map = nullptr ;
596595
597596 std::string_view key;
598597 std::string_view value;
599598
600599 public:
601- explicit StringWriter (absl::flat_hash_map<std::string_view, std::string_view> & map_)
600+ explicit StringWriter (absl::flat_hash_map<std::string_view, std::string_view> * map_)
602601 : map(map_)
603602 {}
604603
605604 StringWriter (ColumnString &, ColumnString &)
606- : map(dummy_map)
607605 {
608606 throw Exception (ErrorCodes::LOGICAL_ERROR, " Constructor should never be called" );
609607 }
@@ -673,13 +671,13 @@ struct ReferencesOnlyStateHandler : public StateHandlerImpl<false>
673671 {
674672 if constexpr (throwOnDuplicate)
675673 {
676- if (const auto it = map. find (key); it != map. end () && it->second != value)
674+ if (const auto it = map-> find (key); it != map-> end () && it->second != value)
677675 {
678676 throw DuplicateFoundException (key, it->second , value);
679677 }
680678 }
681679
682- map[ key] = value;
680+ map-> insert ( std::make_pair ( key, value)) ;
683681
684682 resetValue ();
685683 resetKey ();
You can’t perform that action at this time.
0 commit comments