Fix vector 2.0 case and opt temp column store from_vector
This commit is contained in:
@ -171,6 +171,7 @@ int ObTempColumnStore::Iterator::get_next_batch(const ObExprPtrIArray &exprs,
|
||||
int64_t &read_rows)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
read_rows = 0;
|
||||
if (OB_UNLIKELY(exprs.count() != column_store_->get_col_cnt())) {
|
||||
ret = OB_INVALID_ARGUMENT;
|
||||
LOG_WARN("column count mismatch", K(ret), K(exprs.count()), K(column_store_->get_col_cnt()));
|
||||
|
||||
@ -288,15 +288,18 @@ template<>
|
||||
inline int ObTempColumnStore::from_vector(ObBitmapNullVectorBase *vec, ObExpr *expr, ObEvalCtx &ctx,
|
||||
const int64_t start_pos, const int64_t size)
|
||||
{
|
||||
// reuse null vector memory if there is no null data
|
||||
if (vec->has_null()) {
|
||||
const uint16_t flag = vec->get_flag();
|
||||
ObBitVector &nulls = expr->get_nulls(ctx);
|
||||
nulls.reset(size);
|
||||
nulls.reset(size - start_pos);
|
||||
for (int64_t idx = start_pos; idx < size; ++idx) {
|
||||
if (vec->is_null(idx)) {
|
||||
nulls.set(idx - start_pos);
|
||||
}
|
||||
}
|
||||
vec->from(&nulls, flag);
|
||||
}
|
||||
return common::OB_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
@ -263,6 +263,7 @@ int ObTempRowStore::Iterator::get_next_batch(const ObExprPtrIArray &exprs,
|
||||
const ObCompactRow **stored_rows)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
read_rows = 0;
|
||||
if (OB_FAIL(row_store_->init_batch_ctx())) {
|
||||
LOG_WARN("init batch ctx failed", K(ret));
|
||||
} else if (OB_UNLIKELY(NULL == cur_blk_ || !cur_blk_->contain(cur_blk_id_))) {
|
||||
@ -340,6 +341,7 @@ int ObTempRowStore::Iterator::get_next_batch(const int64_t max_rows,
|
||||
int64_t &read_rows,
|
||||
const ObCompactRow **stored_rows) {
|
||||
int ret = OB_SUCCESS;
|
||||
read_rows = 0;
|
||||
if (OB_ISNULL(stored_rows)) {
|
||||
ret = OB_INVALID_ARGUMENT;
|
||||
LOG_WARN("stored rows is null", K(ret));
|
||||
|
||||
Reference in New Issue
Block a user