github-actions[bot] commented on code in PR #27784: URL: https://github.com/apache/doris/pull/27784#discussion_r1409630545
########## be/src/vec/columns/column_map.cpp: ########## @@ -358,6 +388,25 @@ void ColumnMap::update_crcs_with_value(uint32_t* __restrict hash, PrimitiveType } } +void ColumnMap::update_murmurs_with_value(uint32_t* __restrict hash, PrimitiveType type, uint32_t rows, + uint32_t offset, const uint8_t* __restrict null_data) const { + auto s = rows; + DCHECK(s == size()); + + if (null_data) { + for (size_t i = 0; i < s; ++i) { + // every row + if (null_data[i] == 0) { Review Comment: warning: method 'insert_range_from' can be made static [readability-convert-member-functions-to-static] be/src/vec/columns/column_map.h:100: ```diff - void insert_range_from(const IColumn& src, size_t start, size_t length) override; + static void insert_range_from(const IColumn& src, size_t start, size_t length) override; ``` ########## be/src/vec/columns/column_string.cpp: ########## @@ -219,6 +219,27 @@ void ColumnString::update_crcs_with_value(uint32_t* __restrict hashes, doris::Pr } } +void ColumnString::update_murmurs_with_value(uint32_t* __restrict hashes, doris::PrimitiveType type, + uint32_t rows, uint32_t offset, + const uint8_t* __restrict null_data) const { + auto s = rows; + DCHECK(s == size()); + + if (null_data == nullptr) { + for (size_t i = 0; i < s; i++) { + auto data_ref = get_data_at(i); + hashes[i] = HashUtil::murmur_hash3_32(data_ref.data, data_ref.size, HashUtil::SPARK_MURMUR_32_SEED); Review Comment: warning: method 'filter_by_selector' can be made static [readability-convert-member-functions-to-static] be/src/vec/columns/column_string.h:513: ```diff - Status filter_by_selector(const uint16_t* sel, size_t sel_size, IColumn* col_ptr) override; + static Status filter_by_selector(const uint16_t* sel, size_t sel_size, IColumn* col_ptr) override; ``` ########## be/src/vec/columns/column_decimal.cpp: ########## @@ -183,6 +183,52 @@ void ColumnDecimal<T>::update_crcs_with_value(uint32_t* __restrict hashes, Primi } } +template <typename T> +void ColumnDecimal<T>::update_murmur_with_value(size_t start, size_t end, uint32_t& hash, + const uint8_t* __restrict null_data) const { + if (null_data == nullptr) { + for (size_t i = start; i < end; i++) { + if constexpr (!IsDecimalV2<T>) { + hash = HashUtil::murmur_hash3_32(&data[i], sizeof(T), HashUtil::SPARK_MURMUR_32_SEED); + } else { + decimalv2_do_murmur(i, hash); + } + } + } else { + for (size_t i = start; i < end; i++) { + if (null_data[i] == 0) { + if constexpr (!IsDecimalV2<T>) { + hash = HashUtil::murmur_hash3_32(&data[i], sizeof(T), HashUtil::SPARK_MURMUR_32_SEED); + } else { + decimalv2_do_murmur(i, hash); + } + } + } + } +} + +template <typename T> +void ColumnDecimal<T>::update_murmurs_with_value(uint32_t* __restrict hashes, PrimitiveType type, + uint32_t rows, uint32_t offset, + const uint8_t* __restrict null_data) const { + auto s = rows; + DCHECK(s == size()); + + if constexpr (!IsDecimalV2<T>) { + DO_MURMUR_HASHES_FUNCTION_COLUMN_IMPL(HashUtil::SPARK_MURMUR_32_SEED) + } else { + if (null_data == nullptr) { + for (size_t i = 0; i < s; i++) { + decimalv2_do_murmur(i, hashes[i]); + } + } else { + for (size_t i = 0; i < s; i++) { + if (null_data[i] == 0) decimalv2_do_murmur(i, hashes[i]); Review Comment: warning: statement should be inside braces [readability-braces-around-statements] ```suggestion if (null_data[i] == 0) { decimalv2_do_murmur(i, hashes[i]); } ``` -- 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