HappenLee commented on code in PR #17970: URL: https://github.com/apache/doris/pull/17970#discussion_r1145637506
########## be/src/vec/functions/functions_comparison.h: ########## @@ -104,17 +104,18 @@ struct NumComparisonImpl { /// Generic version, implemented for columns of same type. template <typename Op> struct GenericComparisonImpl { - static void NO_INLINE vector_vector(const IColumn& a, const IColumn& b, - PaddedPODArray<UInt8>& c) { - for (size_t i = 0, size = a.size(); i < size; ++i) + static void vector_vector(const IColumn& a, const IColumn& b, PaddedPODArray<UInt8>& c) { + for (size_t i = 0, size = a.size(); i < size; ++i) { c[i] = Op::apply(a.compare_at(i, i, b, 1), 0); + } } - static void NO_INLINE vector_constant(const IColumn& a, const IColumn& b, - PaddedPODArray<UInt8>& c) { - auto b_materialized = b.clone_resized(1)->convert_to_full_column_if_const(); - for (size_t i = 0, size = a.size(); i < size; ++i) - c[i] = Op::apply(a.compare_at(i, 0, *b_materialized, 1), 0); + static void vector_constant(const IColumn& a, const IColumn& b, PaddedPODArray<UInt8>& c) { + //TODO: double-check this logic. why we use materialization before? + for (size_t i = 0, size = a.size(); i < size; ++i) { + c[i] = Op::apply( + a.compare_at(i, 0, assert_cast<const ColumnConst&>(b).get_data_column(), 1), 0); Review Comment: `assert_cast<const ColumnConst&>(b).get_data_column(), 1` do the work out of for... loop -- 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