github-actions[bot] commented on code in PR #17814: URL: https://github.com/apache/doris/pull/17814#discussion_r1136801722
########## be/src/vec/exec/vaggregation_node.cpp: ########## @@ -217,7 +217,35 @@ void AggregationNode::_init_hash_method(std::vector<VExprContext*>& probe_exprs) case TYPE_CHAR: case TYPE_VARCHAR: case TYPE_STRING: { - _agg_data->init(AggregatedDataVariants::Type::string_key, is_nullable); + if (!probe_exprs[0]->root()->data_type()->have_maximum_size_of_value()) { + _agg_data->init(AggregatedDataVariants::Type::string_key, is_nullable); + } else { + const auto byte_sz = + probe_exprs[0]->root()->data_type()->get_maximum_size_of_value_in_memory(); + _probe_key_sz.push_back(byte_sz); + if (byte_sz <= sizeof(UInt32)) { + if (_is_first_phase) Review Comment: warning: statement should be inside braces [readability-braces-around-statements] ```suggestion if (_is_first_phase) { ``` be/src/vec/exec/vaggregation_node.cpp:228: ```diff - else + } else ``` ########## be/src/vec/exec/vaggregation_node.cpp: ########## @@ -217,7 +217,35 @@ case TYPE_CHAR: case TYPE_VARCHAR: case TYPE_STRING: { - _agg_data->init(AggregatedDataVariants::Type::string_key, is_nullable); + if (!probe_exprs[0]->root()->data_type()->have_maximum_size_of_value()) { + _agg_data->init(AggregatedDataVariants::Type::string_key, is_nullable); + } else { + const auto byte_sz = + probe_exprs[0]->root()->data_type()->get_maximum_size_of_value_in_memory(); + _probe_key_sz.push_back(byte_sz); + if (byte_sz <= sizeof(UInt32)) { + if (_is_first_phase) + _agg_data->init(AggregatedDataVariants::Type::int32_key, is_nullable, true); + else + _agg_data->init(AggregatedDataVariants::Type::int32_key_phase2, is_nullable, + true); + } else if (byte_sz <= sizeof(UInt64)) { + if (_is_first_phase) Review Comment: warning: statement should be inside braces [readability-braces-around-statements] ```suggestion if (_is_first_phase) { ``` be/src/vec/exec/vaggregation_node.cpp:234: ```diff - else + } else ``` ########## be/src/vec/exec/vaggregation_node.cpp: ########## @@ -217,7 +217,35 @@ case TYPE_CHAR: case TYPE_VARCHAR: case TYPE_STRING: { - _agg_data->init(AggregatedDataVariants::Type::string_key, is_nullable); + if (!probe_exprs[0]->root()->data_type()->have_maximum_size_of_value()) { + _agg_data->init(AggregatedDataVariants::Type::string_key, is_nullable); + } else { + const auto byte_sz = + probe_exprs[0]->root()->data_type()->get_maximum_size_of_value_in_memory(); + _probe_key_sz.push_back(byte_sz); + if (byte_sz <= sizeof(UInt32)) { + if (_is_first_phase) + _agg_data->init(AggregatedDataVariants::Type::int32_key, is_nullable, true); + else Review Comment: warning: statement should be inside braces [readability-braces-around-statements] ```suggestion else { ``` be/src/vec/exec/vaggregation_node.cpp:230: ```diff - true); + true); + } ``` ########## be/src/vec/exec/vaggregation_node.cpp: ########## @@ -217,7 +217,35 @@ case TYPE_CHAR: case TYPE_VARCHAR: case TYPE_STRING: { - _agg_data->init(AggregatedDataVariants::Type::string_key, is_nullable); + if (!probe_exprs[0]->root()->data_type()->have_maximum_size_of_value()) { + _agg_data->init(AggregatedDataVariants::Type::string_key, is_nullable); + } else { + const auto byte_sz = + probe_exprs[0]->root()->data_type()->get_maximum_size_of_value_in_memory(); + _probe_key_sz.push_back(byte_sz); + if (byte_sz <= sizeof(UInt32)) { + if (_is_first_phase) + _agg_data->init(AggregatedDataVariants::Type::int32_key, is_nullable, true); + else + _agg_data->init(AggregatedDataVariants::Type::int32_key_phase2, is_nullable, + true); + } else if (byte_sz <= sizeof(UInt64)) { + if (_is_first_phase) + _agg_data->init(AggregatedDataVariants::Type::int64_key, is_nullable, true); + else + _agg_data->init(AggregatedDataVariants::Type::int64_key_phase2, is_nullable, + true); + } else if (byte_sz <= sizeof(UInt128)) { + if (_is_first_phase) + _agg_data->init(AggregatedDataVariants::Type::int128_key, is_nullable, + true); + else Review Comment: warning: statement should be inside braces [readability-braces-around-statements] ```suggestion else { ``` be/src/vec/exec/vaggregation_node.cpp:243: ```diff - is_nullable, true); + is_nullable, true); + } ``` ########## be/src/vec/exec/vaggregation_node.cpp: ########## @@ -217,7 +217,35 @@ case TYPE_CHAR: case TYPE_VARCHAR: case TYPE_STRING: { - _agg_data->init(AggregatedDataVariants::Type::string_key, is_nullable); + if (!probe_exprs[0]->root()->data_type()->have_maximum_size_of_value()) { + _agg_data->init(AggregatedDataVariants::Type::string_key, is_nullable); + } else { + const auto byte_sz = + probe_exprs[0]->root()->data_type()->get_maximum_size_of_value_in_memory(); + _probe_key_sz.push_back(byte_sz); + if (byte_sz <= sizeof(UInt32)) { + if (_is_first_phase) + _agg_data->init(AggregatedDataVariants::Type::int32_key, is_nullable, true); + else + _agg_data->init(AggregatedDataVariants::Type::int32_key_phase2, is_nullable, + true); + } else if (byte_sz <= sizeof(UInt64)) { + if (_is_first_phase) + _agg_data->init(AggregatedDataVariants::Type::int64_key, is_nullable, true); + else + _agg_data->init(AggregatedDataVariants::Type::int64_key_phase2, is_nullable, + true); + } else if (byte_sz <= sizeof(UInt128)) { + if (_is_first_phase) Review Comment: warning: statement should be inside braces [readability-braces-around-statements] ```suggestion if (_is_first_phase) { ``` be/src/vec/exec/vaggregation_node.cpp:241: ```diff - else + } else ``` ########## be/src/vec/exec/vaggregation_node.cpp: ########## @@ -217,7 +217,35 @@ case TYPE_CHAR: case TYPE_VARCHAR: case TYPE_STRING: { - _agg_data->init(AggregatedDataVariants::Type::string_key, is_nullable); + if (!probe_exprs[0]->root()->data_type()->have_maximum_size_of_value()) { + _agg_data->init(AggregatedDataVariants::Type::string_key, is_nullable); + } else { + const auto byte_sz = + probe_exprs[0]->root()->data_type()->get_maximum_size_of_value_in_memory(); + _probe_key_sz.push_back(byte_sz); + if (byte_sz <= sizeof(UInt32)) { + if (_is_first_phase) + _agg_data->init(AggregatedDataVariants::Type::int32_key, is_nullable, true); + else + _agg_data->init(AggregatedDataVariants::Type::int32_key_phase2, is_nullable, + true); + } else if (byte_sz <= sizeof(UInt64)) { + if (_is_first_phase) + _agg_data->init(AggregatedDataVariants::Type::int64_key, is_nullable, true); + else Review Comment: warning: statement should be inside braces [readability-braces-around-statements] ```suggestion else { ``` be/src/vec/exec/vaggregation_node.cpp:236: ```diff - true); + true); + } ``` -- 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