diff --git a/src/Functions/keyvaluepair/src/impl/CHKeyValuePairExtractor.h b/src/Functions/keyvaluepair/src/impl/CHKeyValuePairExtractor.h index 5e2153cf5b7..5f0ff4614de 100644 --- a/src/Functions/keyvaluepair/src/impl/CHKeyValuePairExtractor.h +++ b/src/Functions/keyvaluepair/src/impl/CHKeyValuePairExtractor.h @@ -70,8 +70,6 @@ private: return value_state_handler.read(file, pos, value); case State::READING_QUOTED_VALUE: return value_state_handler.readQuoted(file, pos, value); - case State::READING_EMPTY_VALUE: - return value_state_handler.readEmpty(file, pos, value); case State::FLUSH_PAIR: return flushPair(file, pos, key, value, keys, values, row_offset); case END: diff --git a/src/Functions/keyvaluepair/src/impl/state/State.h b/src/Functions/keyvaluepair/src/impl/state/State.h index 95ac0e66a72..8e9c920e7c3 100644 --- a/src/Functions/keyvaluepair/src/impl/state/State.h +++ b/src/Functions/keyvaluepair/src/impl/state/State.h @@ -15,14 +15,12 @@ enum State READING_QUOTED_KEY, // Tries to read the key value pair delimiter. Might jump to WAITING_KEY, WAITING_VALUE or END. READING_KV_DELIMITER, - // Skip characters until it finds a valid first value character. Might jump to READING_QUOTED_VALUE, READING_EMPTY_VALUE or READING_VALUE. + // Skip characters until it finds a valid first value character. Might jump to READING_QUOTED_VALUE or READING_VALUE. WAITING_VALUE, // Tries to read a value. Jumps to FLUSH_PAIR. READING_VALUE, // Tries to read an quoted/ quoted value. Might jump to FLUSH_PAIR or END. READING_QUOTED_VALUE, - // "Reads" an empty value. Jumps to FLUSH_PAIR. - READING_EMPTY_VALUE, // In this state, both key and value have already been collected and should be flushed. Might jump to WAITING_KEY or END. FLUSH_PAIR, END diff --git a/src/Functions/keyvaluepair/src/impl/state/StateHandler.h b/src/Functions/keyvaluepair/src/impl/state/StateHandler.h index 43ca24df712..21f5ac3640c 100644 --- a/src/Functions/keyvaluepair/src/impl/state/StateHandler.h +++ b/src/Functions/keyvaluepair/src/impl/state/StateHandler.h @@ -35,7 +35,6 @@ concept CInlineEscapingValueStateHandler = requires(ValueStateHandler handler) { handler.wait(std::string_view {}, std::size_t {}) } -> std::same_as; { handler.read(std::string_view {}, std::size_t {}, std::declval()) } -> std::same_as; { handler.readQuoted(std::string_view {}, std::size_t {}, std::declval()) } -> std::same_as; - { handler.readEmpty(std::string_view {}, std::size_t {}, std::declval()) } -> std::same_as; }; template @@ -44,7 +43,6 @@ concept CNoEscapingValueStateHandler = requires(ValueStateHandler handler) { handler.wait(std::string_view {}, std::size_t {}) } -> std::same_as; { handler.read(std::string_view {}, std::size_t {}, std::declval()) } -> std::same_as; { handler.readQuoted(std::string_view {}, std::size_t {}, std::declval()) } -> std::same_as; - { handler.readEmpty(std::string_view {}, std::size_t {}, std::declval()) } -> std::same_as; }; template diff --git a/src/Functions/keyvaluepair/src/impl/state/strategies/escaping/InlineEscapingValueStateHandler.cpp b/src/Functions/keyvaluepair/src/impl/state/strategies/escaping/InlineEscapingValueStateHandler.cpp index 90bbc65e713..954a3c469c0 100644 --- a/src/Functions/keyvaluepair/src/impl/state/strategies/escaping/InlineEscapingValueStateHandler.cpp +++ b/src/Functions/keyvaluepair/src/impl/state/strategies/escaping/InlineEscapingValueStateHandler.cpp @@ -26,10 +26,6 @@ NextState InlineEscapingValueStateHandler::wait(std::string_view file, size_t po { return {pos + 1u, State::READING_QUOTED_VALUE}; } - else if (std::find(pair_delimiters.begin(), pair_delimiters.end(), current_character) != pair_delimiters.end()) - { - return {pos, State::READING_EMPTY_VALUE}; - } else if (key_value_delimiter == current_character) { return {pos, State::WAITING_KEY}; @@ -40,7 +36,7 @@ NextState InlineEscapingValueStateHandler::wait(std::string_view file, size_t po } } - return {pos, State::READING_EMPTY_VALUE}; + return {pos, State::READING_VALUE}; } NextState InlineEscapingValueStateHandler::read(std::string_view file, size_t pos, ElementType & value) const @@ -164,10 +160,4 @@ NextState InlineEscapingValueStateHandler::readQuoted(std::string_view file, siz return {pos, State::END}; } -NextState InlineEscapingValueStateHandler::readEmpty(std::string_view, size_t pos, ElementType & value) -{ - value.clear(); - return {pos + 1, State::FLUSH_PAIR}; -} - } diff --git a/src/Functions/keyvaluepair/src/impl/state/strategies/escaping/InlineEscapingValueStateHandler.h b/src/Functions/keyvaluepair/src/impl/state/strategies/escaping/InlineEscapingValueStateHandler.h index e12888755e8..5412ef82f8b 100644 --- a/src/Functions/keyvaluepair/src/impl/state/strategies/escaping/InlineEscapingValueStateHandler.h +++ b/src/Functions/keyvaluepair/src/impl/state/strategies/escaping/InlineEscapingValueStateHandler.h @@ -22,8 +22,6 @@ public: [[nodiscard]] NextState readQuoted(std::string_view file, size_t pos, ElementType & value) const; - [[nodiscard]] static NextState readEmpty(std::string_view, size_t pos, ElementType & value); - private: Configuration extractor_configuration; std::vector read_needles; diff --git a/src/Functions/keyvaluepair/src/impl/state/strategies/noescaping/NoEscapingValueStateHandler.cpp b/src/Functions/keyvaluepair/src/impl/state/strategies/noescaping/NoEscapingValueStateHandler.cpp index 1e0ab179932..76b12dab19b 100644 --- a/src/Functions/keyvaluepair/src/impl/state/strategies/noescaping/NoEscapingValueStateHandler.cpp +++ b/src/Functions/keyvaluepair/src/impl/state/strategies/noescaping/NoEscapingValueStateHandler.cpp @@ -25,10 +25,6 @@ NextState NoEscapingValueStateHandler::wait(std::string_view file, size_t pos) c { return {pos + 1u, State::READING_QUOTED_VALUE}; } - else if (std::find(pair_delimiters.begin(), pair_delimiters.end(), current_character) != pair_delimiters.end()) - { - return {pos, State::READING_EMPTY_VALUE}; - } else if (key_value_delimiter == current_character) { return {pos, State::WAITING_KEY}; @@ -39,7 +35,7 @@ NextState NoEscapingValueStateHandler::wait(std::string_view file, size_t pos) c } } - return {file.size(), State::READING_EMPTY_VALUE}; + return {file.size(), State::READING_VALUE}; } NextState NoEscapingValueStateHandler::read(std::string_view file, size_t pos, ElementType & value) const @@ -107,10 +103,4 @@ NextState NoEscapingValueStateHandler::readQuoted(std::string_view file, size_t return {file.size(), State::END}; } -NextState NoEscapingValueStateHandler::readEmpty(std::string_view, size_t pos, ElementType & value) -{ - value = {}; - return {pos + 1, State::FLUSH_PAIR}; -} - } diff --git a/src/Functions/keyvaluepair/src/impl/state/strategies/noescaping/NoEscapingValueStateHandler.h b/src/Functions/keyvaluepair/src/impl/state/strategies/noescaping/NoEscapingValueStateHandler.h index 3858b032fa6..1a58da9c1f9 100644 --- a/src/Functions/keyvaluepair/src/impl/state/strategies/noescaping/NoEscapingValueStateHandler.h +++ b/src/Functions/keyvaluepair/src/impl/state/strategies/noescaping/NoEscapingValueStateHandler.h @@ -20,8 +20,6 @@ public: [[nodiscard]] NextState readQuoted(std::string_view file, size_t pos, ElementType & value) const; - [[nodiscard]] static NextState readEmpty(std::string_view, size_t pos, ElementType & value); - private: Configuration extractor_configuration; std::vector read_needles;