Skip to content

Commit 02a6613

Browse files
Merge branch 'apache:master' into s7
2 parents 8228f5c + 3e6d690 commit 02a6613

File tree

51 files changed

+651
-168
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+651
-168
lines changed

.github/workflows/build-thirdparty.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ jobs:
142142
name: Build Third Party Libraries (macOS)
143143
needs: changes
144144
if: ${{ needs.changes.outputs.thirdparty_changes == 'true' }}
145-
runs-on: macos-13
145+
runs-on: macos-15
146146
steps:
147147
- name: Checkout ${{ github.ref }}
148148
uses: actions/checkout@v4

be/src/exec/rowid_fetcher.cpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,27 +38,22 @@
3838
#include <vector>
3939

4040
#include "bthread/countdown_event.h"
41-
#include "cloud/cloud_storage_engine.h"
42-
#include "cloud/cloud_tablet.h"
43-
#include "cloud/cloud_tablet_mgr.h"
44-
#include "cloud/config.h"
4541
#include "common/config.h"
4642
#include "common/consts.h"
4743
#include "common/exception.h"
4844
#include "common/signal_handler.h"
4945
#include "exec/tablet_info.h" // DorisNodesInfo
5046
#include "olap/olap_common.h"
5147
#include "olap/rowset/beta_rowset.h"
48+
#include "olap/rowset/segment_v2/column_reader.h"
5249
#include "olap/storage_engine.h"
5350
#include "olap/tablet_fwd.h"
54-
#include "olap/tablet_manager.h"
5551
#include "olap/tablet_schema.h"
5652
#include "olap/utils.h"
5753
#include "runtime/descriptors.h"
5854
#include "runtime/exec_env.h" // ExecEnv
5955
#include "runtime/fragment_mgr.h" // FragmentMgr
6056
#include "runtime/runtime_state.h" // RuntimeState
61-
#include "runtime/types.h"
6257
#include "runtime/workload_group/workload_group_manager.h"
6358
#include "semaphore"
6459
#include "util/brpc_client_cache.h" // BrpcClientCache
@@ -69,13 +64,11 @@
6964
#include "vec/common/assert_cast.h"
7065
#include "vec/common/string_ref.h"
7166
#include "vec/core/block.h" // Block
72-
#include "vec/data_types/data_type_factory.hpp"
7367
#include "vec/data_types/data_type_struct.h"
7468
#include "vec/data_types/serde/data_type_serde.h"
7569
#include "vec/exec/format/orc/vorc_reader.h"
7670
#include "vec/exec/format/parquet/vparquet_reader.h"
7771
#include "vec/exec/scan/file_scanner.h"
78-
#include "vec/functions/function_helpers.h"
7972
#include "vec/jsonb/serialize.h"
8073

8174
namespace doris {

be/src/index-tools/index_tool.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -621,11 +621,16 @@ int main(int argc, char** argv) {
621621
_CLLDELETE(analyzer);
622622
_CLLDELETE(char_string_reader);
623623

624-
auto ret = index_file_writer->close();
624+
auto ret = index_file_writer->begin_close();
625625
if (!ret.ok()) {
626626
std::cerr << "IndexFileWriter close error:" << ret.msg() << std::endl;
627627
return -1;
628628
}
629+
ret = index_file_writer->finish_close();
630+
if (!ret.ok()) {
631+
std::cerr << "IndexFileWriter wait close error:" << ret.msg() << std::endl;
632+
return -1;
633+
}
629634
} else if (FLAGS_operation == "show_nested_files_v2") {
630635
if (FLAGS_idx_file_path == "") {
631636
std::cout << "no file flag for show " << std::endl;

be/src/olap/base_tablet.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
#include "olap/rowset/rowset.h"
4646
#include "olap/rowset/rowset_fwd.h"
4747
#include "olap/rowset/rowset_reader.h"
48+
#include "olap/rowset/segment_v2/column_reader.h"
4849
#include "olap/tablet_fwd.h"
4950
#include "olap/txn_manager.h"
5051
#include "service/point_query_executor.h"

be/src/olap/delete_bitmap_calculator.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,22 @@
2222
#include "common/cast_set.h"
2323
#include "common/status.h"
2424
#include "olap/primary_key_index.h"
25+
#include "olap/rowset/segment_v2/indexed_column_reader.h"
26+
#include "olap/tablet_meta.h"
2527
#include "vec/data_types/data_type_factory.hpp"
2628

2729
namespace doris {
2830
#include "common/compile_check_begin.h"
31+
32+
MergeIndexDeleteBitmapCalculatorContext::MergeIndexDeleteBitmapCalculatorContext(
33+
std::unique_ptr<segment_v2::IndexedColumnIterator> iter, vectorized::DataTypePtr index_type,
34+
int32_t segment_id, size_t num_rows, size_t batch_max_size)
35+
: _iter(std::move(iter)),
36+
_index_type(std::move(index_type)),
37+
_num_rows(num_rows),
38+
_max_batch_size(batch_max_size),
39+
_segment_id(segment_id) {}
40+
2941
Status MergeIndexDeleteBitmapCalculatorContext::get_current_key(Slice& slice) {
3042
if (_cur_row_id >= _num_rows) {
3143
return Status::EndOfFile("Reach the end of file");

be/src/olap/delete_bitmap_calculator.h

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -27,23 +27,19 @@
2727

2828
#include "common/config.h"
2929
#include "common/status.h"
30-
#include "olap/base_tablet.h"
31-
#include "olap/binlog_config.h"
32-
#include "olap/data_dir.h"
3330
#include "olap/key_coder.h"
3431
#include "olap/olap_common.h"
35-
#include "olap/rowset/rowset.h"
36-
#include "olap/rowset/rowset_meta.h"
37-
#include "olap/rowset/rowset_reader.h"
3832
#include "olap/rowset/segment_v2/segment.h"
39-
#include "olap/tablet_meta.h"
40-
#include "olap/tablet_schema.h"
41-
#include "olap/version_graph.h"
42-
#include "util/metrics.h"
43-
#include "util/once.h"
4433
#include "util/slice.h"
4534

4635
namespace doris {
36+
namespace segment_v2 {
37+
class IndexedColumnIterator;
38+
class Segment;
39+
40+
} // namespace segment_v2
41+
42+
using SegmentSharedPtr = std::shared_ptr<segment_v2::Segment>;
4743

4844
class MergeIndexDeleteBitmapCalculatorContext {
4945
public:
@@ -62,12 +58,7 @@ class MergeIndexDeleteBitmapCalculatorContext {
6258

6359
MergeIndexDeleteBitmapCalculatorContext(std::unique_ptr<segment_v2::IndexedColumnIterator> iter,
6460
vectorized::DataTypePtr index_type, int32_t segment_id,
65-
size_t num_rows, size_t batch_max_size = 1024)
66-
: _iter(std::move(iter)),
67-
_index_type(index_type),
68-
_num_rows(num_rows),
69-
_max_batch_size(batch_max_size),
70-
_segment_id(segment_id) {}
61+
size_t num_rows, size_t batch_max_size = 1024);
7162
Status get_current_key(Slice& slice);
7263
Status advance();
7364
Status seek_at_or_after(Slice const& key);

be/src/olap/rowset/beta_rowset_writer.cpp

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,16 +206,24 @@ Status InvertedIndexFileCollection::add(int seg_id, IndexFileWriterPtr&& index_w
206206
return Status::OK();
207207
}
208208

209-
Status InvertedIndexFileCollection::close() {
209+
Status InvertedIndexFileCollection::begin_close() {
210210
std::lock_guard lock(_lock);
211211
for (auto&& [id, writer] : _inverted_index_file_writers) {
212-
RETURN_IF_ERROR(writer->close());
212+
RETURN_IF_ERROR(writer->begin_close());
213213
_total_size += writer->get_index_file_total_size();
214214
}
215215

216216
return Status::OK();
217217
}
218218

219+
Status InvertedIndexFileCollection::finish_close() {
220+
std::lock_guard lock(_lock);
221+
for (auto&& [id, writer] : _inverted_index_file_writers) {
222+
RETURN_IF_ERROR(writer->finish_close());
223+
}
224+
return Status::OK();
225+
}
226+
219227
Result<std::vector<const InvertedIndexFileInfo*>>
220228
InvertedIndexFileCollection::inverted_index_file_info(int seg_id_offset) {
221229
std::lock_guard lock(_lock);
@@ -1097,7 +1105,8 @@ Status BetaRowsetWriter::create_segment_writer_for_segcompaction(
10971105
_segcompaction_worker->get_file_writer().reset(file_writer.release());
10981106
if (auto& idx_file_writer = _segcompaction_worker->get_inverted_index_file_writer();
10991107
idx_file_writer != nullptr) {
1100-
RETURN_IF_ERROR(idx_file_writer->close());
1108+
RETURN_IF_ERROR(idx_file_writer->begin_close());
1109+
RETURN_IF_ERROR(idx_file_writer->finish_close());
11011110
}
11021111
_segcompaction_worker->get_inverted_index_file_writer().reset(index_file_writer.release());
11031112
return Status::OK();

be/src/olap/rowset/beta_rowset_writer.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,10 @@ class InvertedIndexFileCollection {
9191

9292
// Close all file writers
9393
// If the inverted index file writer is not closed, an error will be thrown during destruction
94-
Status close();
94+
Status begin_close();
95+
96+
// Wait for all inverted index file writers to be closed
97+
Status finish_close();
9598

9699
// Get inverted index file info in segment id order.
97100
// `seg_id_offset` is the offset of the segment id relative to the subscript of `_inverted_index_file_writers`,
@@ -214,9 +217,11 @@ class BaseBetaRowsetWriter : public RowsetWriter {
214217
// Some index files are written during normal compaction and some files are written during index compaction.
215218
// After all index writes are completed, call this method to write the final compound index file.
216219
Status _close_inverted_index_file_writers() {
217-
RETURN_NOT_OK_STATUS_WITH_WARN(_idx_files.close(),
220+
RETURN_NOT_OK_STATUS_WITH_WARN(_idx_files.begin_close(),
218221
"failed to close index file when build new rowset");
219222
this->_total_index_size += _idx_files.get_total_index_size();
223+
RETURN_NOT_OK_STATUS_WITH_WARN(_idx_files.finish_close(),
224+
"failed to wait close index file when build new rowset");
220225
return Status::OK();
221226
}
222227

be/src/olap/rowset/segment_creator.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,9 @@ Status SegmentFlusher::_internal_parse_variant_columns(vectorized::Block& block)
111111
}
112112

113113
Status SegmentFlusher::close() {
114-
return _seg_files.close();
114+
RETURN_IF_ERROR(_seg_files.close());
115+
RETURN_IF_ERROR(_idx_files.finish_close());
116+
return Status::OK();
115117
}
116118

117119
Status SegmentFlusher::_add_rows(std::unique_ptr<segment_v2::SegmentWriter>& segment_writer,

be/src/olap/rowset/segment_v2/column_reader.h

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,14 @@
2424
#include <cstddef> // for size_t
2525
#include <cstdint> // for uint32_t
2626
#include <memory> // for unique_ptr
27-
#include <mutex>
2827
#include <string>
2928
#include <utility>
3029
#include <vector>
3130

3231
#include "common/config.h"
33-
#include "common/exception.h"
3432
#include "common/logging.h"
3533
#include "common/status.h" // for Status
3634
#include "io/fs/file_reader_writer_fwd.h"
37-
#include "io/fs/file_system.h"
3835
#include "io/io_common.h"
3936
#include "olap/olap_common.h"
4037
#include "olap/rowset/segment_v2/common.h"
@@ -50,9 +47,7 @@
5047
#include "util/once.h"
5148
#include "vec/columns/column.h"
5249
#include "vec/columns/column_array.h" // ColumnArray
53-
#include "vec/columns/subcolumn_tree.h"
5450
#include "vec/data_types/data_type.h"
55-
#include "vec/json/path_in_data.h"
5651

5752
namespace doris {
5853
#include "common/compile_check_begin.h"
@@ -662,7 +657,7 @@ class RowIdColumnIterator : public ColumnIterator {
662657

663658
Status next_batch(size_t* n, vectorized::MutableColumnPtr& dst, bool* has_null) override {
664659
for (size_t i = 0; i < *n; ++i) {
665-
rowid_t row_id = cast_set<uint32_t>(_current_rowid + i);
660+
const auto row_id = cast_set<uint32_t>(_current_rowid + i);
666661
GlobalRowLoacation location(_tablet_id, _rowset_id, _segment_id, row_id);
667662
dst->insert_data(reinterpret_cast<const char*>(&location), sizeof(GlobalRowLoacation));
668663
}
@@ -722,14 +717,12 @@ class RowIdColumnIteratorV2 : public ColumnIterator {
722717
// This iterator is used to read default value column
723718
class DefaultValueColumnIterator : public ColumnIterator {
724719
public:
725-
DefaultValueColumnIterator(bool has_default_value, const std::string& default_value,
726-
bool is_nullable, TypeInfoPtr type_info, int precision, int scale)
720+
DefaultValueColumnIterator(bool has_default_value, std::string default_value, bool is_nullable,
721+
TypeInfoPtr type_info, int precision, int scale)
727722
: _has_default_value(has_default_value),
728-
_default_value(default_value),
723+
_default_value(std::move(default_value)),
729724
_is_nullable(is_nullable),
730725
_type_info(std::move(type_info)),
731-
_is_default_value_null(false),
732-
_type_size(0),
733726
_precision(precision),
734727
_scale(scale) {}
735728

@@ -766,8 +759,8 @@ class DefaultValueColumnIterator : public ColumnIterator {
766759
std::string _default_value;
767760
bool _is_nullable;
768761
TypeInfoPtr _type_info;
769-
bool _is_default_value_null;
770-
size_t _type_size;
762+
bool _is_default_value_null {false};
763+
size_t _type_size {0};
771764
int _precision;
772765
int _scale;
773766
std::vector<char> _mem_value;

0 commit comments

Comments
 (0)