-
Notifications
You must be signed in to change notification settings - Fork 3.6k
[fix](datatype)Fix unaligned memory access in read_column_from_arrow #58002
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
[fix](datatype)Fix unaligned memory access in read_column_from_arrow #58002
Conversation
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
bed85c4 to
24937de
Compare
| if (!concrete_array->IsNull(offset_i)) { | ||
| const auto* raw_data = buffer->data() + concrete_array->value_offset(offset_i); | ||
| const auto raw_data_len = concrete_array->value_length(offset_i); | ||
| int32_t start_offset; |
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.
变量一定得初始化
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.
好的,我都添加一下
| } | ||
| for (auto value_i = start; value_i < end; ++value_i) { | ||
| auto utc_epoch = static_cast<UInt64>(concrete_array->Value(value_i)); | ||
| int64_t utc_epoch_raw; |
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.
这些有单测吗?
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.
我补充一下,我想办法构造下各类型的内存未对齐的arrow数据场景
|
run buildall |
TPC-H: Total hot run time: 33977 ms |
TPC-DS: Total hot run time: 187925 ms |
ClickBench: Total hot run time: 27.38 s |
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
|
PR approved by at least one committer and no changes requested. |
|
PR approved by anyone and no changes requested. |
80b554e to
b5ae674
Compare
|
run buildall |
|
PR approved by at least one committer and no changes requested. |
TPC-H: Total hot run time: 34297 ms |
TPC-DS: Total hot run time: 187936 ms |
ClickBench: Total hot run time: 27.92 s |
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
b5ae674 to
0a24ddd
Compare
|
run buildall |
TPC-H: Total hot run time: 34334 ms |
TPC-DS: Total hot run time: 188375 ms |
ClickBench: Total hot run time: 27.89 s |
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
kaka11chen
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
…58002) Fix memory alignment issues in read_column_from_arrow by using memcpy This PR addresses potential memory alignment problems when reading data from Arrow arrays in the `read_column_from_arrow` method. Instead of directly casting potentially unaligned pointers, we now use `memcpy` to safely copy data into properly aligned memory, preventing misaligned address runtime errors. Followup #55274
…pache#58002) Fix memory alignment issues in read_column_from_arrow by using memcpy This PR addresses potential memory alignment problems when reading data from Arrow arrays in the `read_column_from_arrow` method. Instead of directly casting potentially unaligned pointers, we now use `memcpy` to safely copy data into properly aligned memory, preventing misaligned address runtime errors. Followup apache#55274
…pache#58002) Fix memory alignment issues in read_column_from_arrow by using memcpy This PR addresses potential memory alignment problems when reading data from Arrow arrays in the `read_column_from_arrow` method. Instead of directly casting potentially unaligned pointers, we now use `memcpy` to safely copy data into properly aligned memory, preventing misaligned address runtime errors. Followup apache#55274
…_from_arrow #58002 (#58202) Cherry-picked from #58002 Co-authored-by: Chen768959 <[email protected]>
Fix memory alignment issues in read_column_from_arrow by using memcpy
This PR addresses potential memory alignment problems when reading data from Arrow arrays in the
read_column_from_arrowmethod. Instead of directly casting potentially unaligned pointers, we now usememcpyto safely copy data into properly aligned memory, preventing misaligned address runtime errors.Followup #55274