-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[Feature](datatype) add be ut codes for IPv4/v6 #26534
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
| } | ||
|
|
||
| static void set_to_max(void* buf) { | ||
| *reinterpret_cast<uint32_t*>(buf) = 0xFFFFFFFF; // 255.255.255.255 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: 0xFFFFFFFF is a magic number; consider replacing it with a named constant [readability-magic-numbers]
*reinterpret_cast<uint32_t*>(buf) = 0xFFFFFFFF; // 255.255.255.255
^| Status DataTypeIPv4SerDe::serialize_one_cell_to_json(const IColumn& column, int row_num, BufferWritable& bw, | ||
| FormatOptions& options) const { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: method 'serialize_one_cell_to_json' can be made static [readability-convert-member-functions-to-static]
| Status DataTypeIPv4SerDe::serialize_one_cell_to_json(const IColumn& column, int row_num, BufferWritable& bw, | |
| FormatOptions& options) const { | |
| static Status DataTypeIPv4SerDe::serialize_one_cell_to_json(const IColumn& column, int row_num, BufferWritable& bw, | |
| FormatOptions& options) { |
| Status DataTypeIPv4SerDe::deserialize_one_cell_from_json(IColumn& column, Slice& slice, | ||
| const FormatOptions& options) const { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: method 'deserialize_one_cell_from_json' can be made static [readability-convert-member-functions-to-static]
| Status DataTypeIPv4SerDe::deserialize_one_cell_from_json(IColumn& column, Slice& slice, | |
| const FormatOptions& options) const { | |
| static Status DataTypeIPv4SerDe::deserialize_one_cell_from_json(IColumn& column, Slice& slice, | |
| const FormatOptions& options) { |
| Status DataTypeIPv6SerDe::serialize_one_cell_to_json(const IColumn& column, int row_num, BufferWritable& bw, | ||
| FormatOptions& options) const { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: method 'serialize_one_cell_to_json' can be made static [readability-convert-member-functions-to-static]
| Status DataTypeIPv6SerDe::serialize_one_cell_to_json(const IColumn& column, int row_num, BufferWritable& bw, | |
| FormatOptions& options) const { | |
| static Status DataTypeIPv6SerDe::serialize_one_cell_to_json(const IColumn& column, int row_num, BufferWritable& bw, | |
| FormatOptions& options) { |
| Status DataTypeIPv6SerDe::deserialize_one_cell_from_json(IColumn& column, Slice& slice, | ||
| const FormatOptions& options) const { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: method 'deserialize_one_cell_from_json' can be made static [readability-convert-member-functions-to-static]
| Status DataTypeIPv6SerDe::deserialize_one_cell_from_json(IColumn& column, Slice& slice, | |
| const FormatOptions& options) const { | |
| static Status DataTypeIPv6SerDe::deserialize_one_cell_from_json(IColumn& column, Slice& slice, | |
| const FormatOptions& options) { |
| {"k6", FieldType::OLAP_FIELD_TYPE_DECIMAL64, 6, TYPE_DECIMAL64, false}, | ||
| {"k12", FieldType::OLAP_FIELD_TYPE_DATETIMEV2, 12, TYPE_DATETIMEV2, false}, | ||
| {"k8", FieldType::OLAP_FIELD_TYPE_IPV4, 8, TYPE_IPV4, false}, | ||
| {"k9", FieldType::OLAP_FIELD_TYPE_IPV6, 9, TYPE_IPV6, false}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: 9 is a magic number; consider replacing it with a named constant [readability-magic-numbers]
{"k9", FieldType::OLAP_FIELD_TYPE_IPV6, 9, TYPE_IPV6, false},
^| { | ||
| auto vec = vectorized::ColumnVector<IPv4>::create(); | ||
| auto& data = vec->get_data(); | ||
| for (int i = 0; i < 1024; ++i) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: 1024 is a magic number; consider replacing it with a named constant [readability-magic-numbers]
for (int i = 0; i < 1024; ++i) {
^| { | ||
| auto vec = vectorized::ColumnVector<IPv6>::create(); | ||
| auto& data = vec->get_data(); | ||
| for (int i = 0; i < 1024; ++i) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: 1024 is a magic number; consider replacing it with a named constant [readability-magic-numbers]
for (int i = 0; i < 1024; ++i) {
^| { | ||
| auto vec = vectorized::ColumnVector<IPv4>::create(); | ||
| auto& data = vec->get_data(); | ||
| for (int i = 0; i < 1024; ++i) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: 1024 is a magic number; consider replacing it with a named constant [readability-magic-numbers]
for (int i = 0; i < 1024; ++i) {
^| { | ||
| auto vec = vectorized::ColumnVector<IPv6>::create(); | ||
| auto& data = vec->get_data(); | ||
| for (int i = 0; i < 1024; ++i) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: 1024 is a magic number; consider replacing it with a named constant [readability-magic-numbers]
for (int i = 0; i < 1024; ++i) {
^|
run buildall |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
| return _write_column_to_mysql(column, row_buffer, row_idx, col_const); | ||
| } | ||
|
|
||
| Status DataTypeIPv4SerDe::serialize_one_cell_to_json(const IColumn& column, int row_num, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: method 'serialize_one_cell_to_json' can be made static [readability-convert-member-functions-to-static]
| Status DataTypeIPv4SerDe::serialize_one_cell_to_json(const IColumn& column, int row_num, | |
| static Status DataTypeIPv4SerDe::serialize_one_cell_to_json(const IColumn& column, int row_num, |
be/src/vec/data_types/serde/data_type_ipv4_serde.cpp:66:
- FormatOptions& options) const {
+ FormatOptions& options) {| return _write_column_to_mysql(column, row_buffer, row_idx, col_const); | ||
| } | ||
|
|
||
| Status DataTypeIPv6SerDe::serialize_one_cell_to_json(const IColumn& column, int row_num, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: method 'serialize_one_cell_to_json' can be made static [readability-convert-member-functions-to-static]
| Status DataTypeIPv6SerDe::serialize_one_cell_to_json(const IColumn& column, int row_num, | |
| static Status DataTypeIPv6SerDe::serialize_one_cell_to_json(const IColumn& column, int row_num, |
be/src/vec/data_types/serde/data_type_ipv6_serde.cpp:66:
- FormatOptions& options) const {
+ FormatOptions& options) {|
TeamCity be ut coverage result: |
|
(From new machine)TeamCity pipeline, clickbench performance test result: |
| int row_idx, bool col_const) const override; | ||
| Status write_column_to_mysql(const IColumn& column, MysqlRowBuffer<false>& row_buffer, | ||
| int row_idx, bool col_const) const override; | ||
| Status serialize_one_cell_to_json(const IColumn& column, int row_num, BufferWritable& bw, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why here has impl serialize_column_to_json/deserialize_column_from_json
|
run PipelineX |
|
run p0 PipelineX |
|
run buildall |
|
(From new machine)TeamCity pipeline, clickbench performance test result: |
|
TeamCity be ut coverage result: |
TPC-H test result on machine: 'aliyun_ecs.c7a.8xlarge_32C64G' |
|
run p0 |
|
run buildall |
|
TeamCity be ut coverage result: |
TPC-H test result on machine: 'aliyun_ecs.c7a.8xlarge_32C64G' |
|
(From new machine)TeamCity pipeline, clickbench performance test result: |
|
run p0 |
amorynan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
PR approved by anyone and no changes requested. |
|
PR approved by at least one committer and no changes requested. |
Add unit test codes for IP types
Proposed changes
Issue Number: close #21370
Add unit test codes for IP types. Based on pr 24965
Further comments
If this is a relatively large or complex change, kick off the discussion at dev@doris.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...