github-actions[bot] commented on code in PR #15945: URL: https://github.com/apache/doris/pull/15945#discussion_r1070627284
########## be/src/vec/exprs/table_function/vexplode_split.cpp: ########## @@ -63,17 +80,31 @@ Status VExplodeSplitTableFunction::process_row(size_t row_idx) { _is_current_empty = false; _eos = false; - StringRef text = _text_column->get_data_at(row_idx); - StringRef delimiter = _delimiter_column->get_data_at(row_idx); - - if (text.data == nullptr) { + if ((!_test_null_map and _test_null_map[row_idx]) || _delimiter.data == nullptr) { _is_current_empty = true; _cur_size = 0; _cur_offset = 0; } else { - //TODO: implement non-copy split string reference - _backup = strings::Split(StringPiece((char*)text.data, text.size), - StringPiece((char*)delimiter.data, delimiter.size)); + auto split = [](std::string_view strv, std::string_view delims = " ") { + std::vector<std::string_view> output; + auto first = strv.begin(); + + while (first != strv.end()) { + const auto second = std::find_first_of(first, std::cend(strv), std::cbegin(delims), + std::cend(delims)); + if (first != second) { + output.emplace_back(strv.substr(std::distance(strv.begin(), first), + std::distance(first, second))); + } + + if (second == strv.end()) break; Review Comment: warning: statement should be inside braces [readability-braces-around-statements] ```suggestion if (second == strv.end()) { break; } ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org