-
Notifications
You must be signed in to change notification settings - Fork 14
[Join] Zero-copy storage column check. #623
Conversation
@@ -187,6 +187,53 @@ std::unique_ptr<AbstractDataToken> ArrowStorage::getZeroCopyBufferMemory( | |||
return nullptr; | |||
} | |||
|
|||
std::unique_ptr<AbstractDataToken> ArrowStorage::getZeroCopyColumnData( | |||
const ColumnRef& col_ref) { |
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.
Almost copy-paste of getZeroCopyBufferMemory
. Should we unite this methods, or add private utility method?
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.
Marking it as temporary solution, should be removed in further prs.
@@ -436,6 +436,12 @@ ResultSetRegistry::getZeroCopyBufferMemory(const ChunkKey& key, size_t num_bytes | |||
: nullptr; | |||
} | |||
|
|||
std::unique_ptr<AbstractDataToken> ResultSetRegistry::getZeroCopyColumnData( | |||
const ColumnRef& col_ref) { | |||
// UNREACHABLE(); |
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.
not sure how to handle this case correctly, should we support it?
a39fffe
to
35046cb
Compare
f9f7000
to
b42d496
Compare
, direct_columnar_conversion_(false) | ||
, thread_idx_(thread_idx) { | ||
auto timer = DEBUG_TIMER(__func__); | ||
const bool is_varlen = target_type->isArray() || target_type->isString(); |
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.
This is incorrect, we have fixed-length arrays. Proper check is target_type->isVarLen()
.
size_t arrow_elem_size = fixed_type->bit_width() / 8; | ||
size_t elems = elem_size / arrow_elem_size; | ||
CHECK_GT(elems, (size_t)0); | ||
auto data_to_fetch = table.col_data[col_idx]; |
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.
auto data_to_fetch = table.col_data[col_idx]; | |
auto &data_to_fetch = table.col_data[col_idx]; |
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.
Fixed PTAL
b42d496
to
ec29e93
Compare
@@ -203,7 +248,7 @@ void ArrowStorage::fetchFixedLenData(const TableData& table, | |||
// to get a proper slice. | |||
size_t elems = elem_size / arrow_elem_size; | |||
CHECK_GT(elems, (size_t)0); | |||
auto data_to_fetch = | |||
const auto& data_to_fetch = |
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.
Slice
creates a new shared_ptr
, therefore you cannot use reference here and all other similar places.
ec29e93
to
a3cf4a0
Compare
This commit adds check for valid pointer to column buffer to skip copying. Most effective with enabled `enable-non-lazy-data-import` option. Checks number of chunks in storage. Partially resolves: #574 Signed-off-by: Dmitrii Makarenko <[email protected]>
a3cf4a0
to
0b46841
Compare
This commit adds check for valid pointer to column buffer to skip copying. Most effective with enabled
enable-non-lazy-data-import
option. Checks number of chunks in storage.Partially resolves: #574