[refine](util) add cast_to_column to cast ColumnPtr #58092
Conversation
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
|
run buildall |
TPC-H: Total hot run time: 34114 ms |
TPC-DS: Total hot run time: 188488 ms |
ClickBench: Total hot run time: 27.6 s |
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
d1f9ba3 to
797bc20
Compare
|
run buildall |
TPC-H: Total hot run time: 36086 ms |
TPC-DS: Total hot run time: 179320 ms |
ClickBench: Total hot run time: 27.53 s |
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
797bc20 to
0aa4d21
Compare
|
run buildall |
TPC-H: Total hot run time: 36552 ms |
TPC-DS: Total hot run time: 178620 ms |
ClickBench: Total hot run time: 27.51 s |
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
|
run buildall |
TPC-DS: Total hot run time: 180711 ms |
ClickBench: Total hot run time: 27.1 s |
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
BE Regression && 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. |
### What problem does this PR solve? Related PR: #63491, #63678, #63946, #58092 Problem Summary: Backport the column strong-typing refinements for branch-4.1: use strong typed nullable null maps, array offsets, and map offsets, and apply the column check helper for type casts. Branch-4.1 was missing the COW/Column cast helper introduced by #58092, so this also ports the minimal helper API needed by the picked changes and adjusts an old array distance code path to use the already strong typed offsets pointer. ### Release note None ### Check List (For Author) - Test <!-- At least one of them must be included. --> - [ ] Regression test - [ ] Unit Test - [ ] Manual test (add detailed scripts or steps below) - [ ] No need to test or manual test. Explain why: - [ ] This is a refactor/code format and no logic has been changed. - [ ] Previous test can cover this change. - [ ] No code files have been changed. - [ ] Other reason <!-- Add your reason? --> - Behavior changed: - [ ] No. - [ ] Yes. <!-- Explain the behavior change --> - Does this need documentation? - [ ] No. - [ ] Yes. <!-- Add document PR link here. eg: apache/doris-website#1214 --> ### Check List (For Reviewer who merge this PR) - [ ] Confirm the release note - [ ] Confirm test cases - [ ] Confirm document - [ ] Add branch pick label <!-- Add branch pick label that this PR should merge into -->
What problem does this PR solve?
This is similar to std::dynamic_pointer_cast.
ColumnPtr column_ptr = ColumnHelper::create_column<DataTypeInt32>({1, 2, 3}); EXPECT_EQ(column_ptr->use_count(), 1); ColumnInt32::Ptr column_i32 = cast_to_column<ColumnInt32>(column_ptr); EXPECT_TRUE(column_i32); EXPECT_EQ(column_ptr->use_count(), 2); EXPECT_EQ(column_i32->use_count(), 2); MutableColumnPtr column_ptr = ColumnInt32::create(); EXPECT_EQ(column_ptr->use_count(), 1); ColumnInt32::MutablePtr column_i32 = cast_to_column<ColumnInt32>(std::move(column_ptr)); EXPECT_TRUE(column_i32); EXPECT_EQ(column_i32->use_count(), 1);Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)