From 2d581956b13af583946f503fa6ec05dec4e198d5 Mon Sep 17 00:00:00 2001 From: chaoyli Date: Thu, 18 Jul 2019 15:53:24 +0800 Subject: [PATCH] Fix rollup bug when init RowCursor When doing rollup, seek_columns equals to the complete set of tablet's columns. There is no necessity to set it. --- be/src/olap/rowset/alpha_rowset_reader.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/be/src/olap/rowset/alpha_rowset_reader.cpp b/be/src/olap/rowset/alpha_rowset_reader.cpp index 4d67284caf3b24..59540d4bd7185d 100644 --- a/be/src/olap/rowset/alpha_rowset_reader.cpp +++ b/be/src/olap/rowset/alpha_rowset_reader.cpp @@ -95,8 +95,14 @@ OLAPStatus AlphaRowsetReader::init(RowsetReaderContext* read_context) { LOG(WARNING) << "allocate memory for row cursor failed"; return OLAP_ERR_MALLOC_ERROR; } - _dst_cursor->init(*(_current_read_context->tablet_schema), - *(_current_read_context->seek_columns)); + if (_current_read_context->reader_type == READER_ALTER_TABLE) { + // Upon rollup/alter table, seek_columns is nullptr. + // Under this circumstance, init RowCursor with all columns. + _dst_cursor->init(*(_current_read_context->tablet_schema)); + } else { + _dst_cursor->init(*(_current_read_context->tablet_schema), + *(_current_read_context->seek_columns)); + } for (size_t i = 0; i < _merge_ctxs.size(); ++i) { _merge_ctxs[i].row_cursor.reset(new (std::nothrow) RowCursor()); _merge_ctxs[i].row_cursor->init(*(_current_read_context->tablet_schema),