This is an automated email from the ASF dual-hosted git repository.
csun5285 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new a92160b77e0 [fix](benchmark) Build be/benchmark (#67029)
a92160b77e0 is described below
commit a92160b77e0f9971346d01a1c9b65b994a14563e
Author: Chenyang Sun <[email protected]>
AuthorDate: Mon Aug 24 20:37:49 2026 +0800
[fix](benchmark) Build be/benchmark (#67029)
[fix](benchmark) Build be/benchmark (#67029)
---
be/benchmark/benchmark_variant_segment.hpp | 33 +++++++++-------------
be/benchmark/parquet/benchmark_parquet_kernels.hpp | 6 ++--
2 files changed, 18 insertions(+), 21 deletions(-)
diff --git a/be/benchmark/benchmark_variant_segment.hpp
b/be/benchmark/benchmark_variant_segment.hpp
index b6721ec5faf..9cbc24164ab 100644
--- a/be/benchmark/benchmark_variant_segment.hpp
+++ b/be/benchmark/benchmark_variant_segment.hpp
@@ -165,7 +165,7 @@ struct PreparedSegment {
struct PreparedScan {
PreparedSegment* fixture = nullptr;
TabletSchemaSPtr query_schema;
- SchemaSPtr scan_schema;
+ ReadSchemaSPtr scan_schema;
ColumnId output_column_id = 0;
ReadTarget target = ReadTarget::WHOLE;
};
@@ -538,8 +538,8 @@ public:
prepared->fixture = fixture;
prepared->query_schema = std::move(query_schema);
- prepared->scan_schema =
std::make_shared<Schema>(prepared->query_schema->columns(),
- std::vector<ColumnId>
{output_id});
+ prepared->scan_schema =
std::make_shared<ReadSchema>(project_columns_by_ordinal(
+ prepared->query_schema->columns(), std::vector<ColumnId>
{output_id}));
prepared->output_column_id = output_id;
prepared->target = target;
return Status::OK();
@@ -553,10 +553,10 @@ public:
if (key_id < 0 || root_id < 0) {
return Status::InternalError("Variant rewrite benchmark columns
are missing");
}
- prepared->scan_schema =
- std::make_shared<Schema>(prepared->query_schema->columns(),
- std::vector<ColumnId>
{static_cast<ColumnId>(key_id),
-
static_cast<ColumnId>(root_id)});
+ prepared->scan_schema = std::make_shared<ReadSchema>(
+ project_columns_by_ordinal(prepared->query_schema->columns(),
+ std::vector<ColumnId>
{static_cast<ColumnId>(key_id),
+
static_cast<ColumnId>(root_id)}));
return Status::OK();
}
@@ -604,12 +604,7 @@ public:
RETURN_IF_ERROR(writer.init());
result->writer_init_ns += elapsed_ns(writer_init_start);
- const int32_t key_id = prepared.query_schema->field_index(KEY_UID);
- const int32_t root_id = prepared.query_schema->field_index(ROOT_UID);
- DORIS_CHECK_GE(key_id, 0);
- DORIS_CHECK_GE(root_id, 0);
- Block block = prepared.query_schema->create_block_by_cids(
- {static_cast<uint32_t>(key_id),
static_cast<uint32_t>(root_id)});
+ Block block = prepared.scan_schema->create_read_block();
bool checked_representation = false;
while (true) {
const auto read_start = std::chrono::steady_clock::now();
@@ -817,8 +812,7 @@ public:
RowwiseIteratorUPtr iterator;
RETURN_IF_ERROR(
prepared.fixture->segment->new_iterator(prepared.scan_schema,
options, &iterator));
- Block block = prepared.query_schema->create_block_by_cids(
- {static_cast<uint32_t>(prepared.output_column_id)});
+ Block block = prepared.scan_schema->create_read_block();
while (true) {
Status status = iterator->next_batch(&block);
if (status.is<ErrorCode::END_OF_FILE>()) {
@@ -1508,8 +1502,9 @@ private:
};
const uint32_t hot_id = append_path(HOT_PATH);
const uint32_t sparse_id = append_path(SPARSE_PATH);
- std::vector<uint32_t> return_columns {0,
static_cast<uint32_t>(root_index), hot_id,
- sparse_id};
+ auto read_schema =
std::make_shared<ReadSchema>(project_columns_by_ordinal(
+ query_schema->columns(),
+ std::vector<ColumnId> {0, static_cast<ColumnId>(root_index),
hot_id, sparse_id}));
RowsetReaderSharedPtr reader;
RETURN_IF_ERROR(output->create_reader(&reader));
@@ -1518,7 +1513,7 @@ private:
context.reader_type = ReaderType::READER_QUERY;
context.tablet_schema = query_schema;
context.need_ordered_result = true;
- context.return_columns = &return_columns;
+ context.read_schema = read_schema;
context.stats = &statistics;
RETURN_IF_ERROR(reader->init(&context));
@@ -1531,7 +1526,7 @@ private:
uint32_t sparse_hits = 0;
bool saw_current_compactor = false;
while (true) {
- Block block = query_schema->create_block_by_cids(return_columns);
+ Block block = read_schema->create_read_block();
Status status = reader->next_batch(&block);
if (status.is<ErrorCode::END_OF_FILE>()) {
break;
diff --git a/be/benchmark/parquet/benchmark_parquet_kernels.hpp
b/be/benchmark/parquet/benchmark_parquet_kernels.hpp
index 0d15678be66..d58385cf7e7 100644
--- a/be/benchmark/parquet/benchmark_parquet_kernels.hpp
+++ b/be/benchmark/parquet/benchmark_parquet_kernels.hpp
@@ -236,8 +236,10 @@ inline void
run_nullable_selection_kernel(benchmark::State& state,
state.SkipWithError(status.to_string().c_str());
return;
}
- benchmark::DoNotOptimize(scratch.physical_selection.ranges);
- benchmark::DoNotOptimize(scratch.selected_nulls);
+ auto* selection_ranges = scratch.physical_selection.ranges.data();
+ auto* selected_nulls = scratch.selected_nulls.data();
+ benchmark::DoNotOptimize(selection_ranges);
+ benchmark::DoNotOptimize(selected_nulls);
benchmark::ClobberMemory();
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]