Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion be/src/agent/be_exec_version_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,16 @@ class BeExecVersionManager {
* b. clear old version of version 3->4
* c. change FunctionIsIPAddressInRange from AlwaysNotNullable to DependOnArguments
* d. change some agg function nullable property: PR #37215
* e. change variant serde to fix PR #38413
*/
constexpr inline int BeExecVersionManager::max_be_exec_version = 5;
constexpr inline int BeExecVersionManager::max_be_exec_version = 6;
constexpr inline int BeExecVersionManager::min_be_exec_version = 0;

/// functional
constexpr inline int BITMAP_SERDE = 3;
constexpr inline int USE_NEW_SERDE = 4; // release on DORIS version 2.1
constexpr inline int OLD_WAL_SERDE = 3; // use to solve compatibility issues, see pr #32299
constexpr inline int AGG_FUNCTION_NULLABLE = 5; // change some agg nullable property: PR #37215
constexpr inline int VARIANT_SERDE = 6; // change variant serde to fix PR #38413

} // namespace doris
5 changes: 5 additions & 0 deletions be/src/olap/rowset/segment_v2/segment_iterator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -699,6 +699,11 @@ Status SegmentIterator::_get_row_ranges_from_conditions(RowRanges* condition_row
if (_opts.io_ctx.reader_type == ReaderType::READER_QUERY) {
RowRanges dict_row_ranges = RowRanges::create_single(num_rows());
for (auto cid : cids) {
if (!_segment->can_apply_predicate_safely(cid,
_opts.col_id_to_predicates.at(cid).get(),
*_schema, _opts.io_ctx.reader_type)) {
continue;
}
RowRanges tmp_row_ranges = RowRanges::create_single(num_rows());
DCHECK(_opts.col_id_to_predicates.count(cid) > 0);
RETURN_IF_ERROR(_column_iterators[cid]->get_row_ranges_by_dict(
Expand Down
18 changes: 17 additions & 1 deletion be/src/vec/data_types/data_type_object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include <utility>
#include <vector>

#include "agent/be_exec_version_manager.h"
#include "vec/columns/column_object.h"
#include "vec/common/assert_cast.h"
#include "vec/common/typeid_cast.h"
Expand Down Expand Up @@ -66,7 +67,6 @@ int64_t DataTypeObject::get_uncompressed_serialized_bytes(const IColumn& column,
if (is_nothing(type)) {
continue;
}

PColumnMeta column_meta_pb;
column_meta_pb.set_name(entry->path.get_path());
type->to_pb_column_meta(&column_meta_pb);
Expand All @@ -78,6 +78,10 @@ int64_t DataTypeObject::get_uncompressed_serialized_bytes(const IColumn& column,
size += type->get_uncompressed_serialized_bytes(entry->data.get_finalized_column(),
be_exec_version);
}
// serialize num of rows, only take effect when subcolumns empty
if (be_exec_version >= VARIANT_SERDE) {
size += sizeof(uint32_t);
}

return size;
}
Expand Down Expand Up @@ -121,6 +125,11 @@ char* DataTypeObject::serialize(const IColumn& column, char* buf, int be_exec_ve
}
// serialize num of subcolumns
*reinterpret_cast<uint32_t*>(size_pos) = num_of_columns;
// serialize num of rows, only take effect when subcolumns empty
if (be_exec_version >= VARIANT_SERDE) {
*reinterpret_cast<uint32_t*>(buf) = column_object.rows();
buf += sizeof(uint32_t);
}

return buf;
}
Expand Down Expand Up @@ -155,6 +164,13 @@ const char* DataTypeObject::deserialize(const char* buf, IColumn* column,
}
column_object->add_sub_column(key, std::move(sub_column), type);
}
size_t num_rows = 0;
// serialize num of rows, only take effect when subcolumns empty
if (be_exec_version >= VARIANT_SERDE) {
num_rows = *reinterpret_cast<const uint32_t*>(buf);
column_object->set_num_rows(num_rows);
buf += sizeof(uint32_t);
}

column_object->finalize();
#ifndef NDEBUG
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1827,7 +1827,7 @@ public class Config extends ConfigBase {
* Max data version of backends serialize block.
*/
@ConfField(mutable = false)
public static int max_be_exec_version = 5;
public static int max_be_exec_version = 6;

/**
* Min data version of backends serialize block.
Expand Down
16 changes: 16 additions & 0 deletions regression-test/data/variant_p0/rqg/rqg4.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
-- This file is automatically generated. You should know what you did if you want to edit this
-- !rqg4 --
0

-- !rqg4_2 --
500

-- !rqg4_3 --
500

-- !rqg4_4 --
70

-- !rqg4_5 --
70

67 changes: 67 additions & 0 deletions regression-test/data/variant_p0/rqg/rqg5.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
-- This file is automatically generated. You should know what you did if you want to edit this
-- !rqg5 --
0

-- !rqg5_2 --
50

-- !rqg5_3 --
50

-- !rqg5_4 --
50

-- !rqg5_5 --
50

-- !rqg5_6 --
50

-- !rqg5_7 --
0

-- !rqg5_8 --
0

-- !rqg5_9 --
50

-- !rqg5_10 --
50

-- !rqg5_11 --
50

-- !rqg5_12 --
50

-- !rqg5_13 --
50

-- !rqg5_14 --
50

-- !rqg5_15 --
0

-- !rqg5_16 --
100

-- !rqg5_17 --
100

-- !rqg5_18 --
100

-- !rqg5_19 --
100

-- !rqg5_20 --
100

-- !rqg5_21 --
100

-- !rqg5_22 --
0

6 changes: 6 additions & 0 deletions regression-test/suites/variant_p0/rqg/rqg4.sql

Large diffs are not rendered by default.

22 changes: 22 additions & 0 deletions regression-test/suites/variant_p0/rqg/rqg5.sql

Large diffs are not rendered by default.