|
37 | 37 | #include "io/fs/file_system.h" |
38 | 38 | #include "io/fs/file_writer.h" |
39 | 39 | #include "io/fs/local_file_system.h" |
| 40 | +#include "io/fs/hdfs_file_writer.h" |
| 41 | +#include "io/fs/s3_file_writer.h" |
40 | 42 | #include "olap/data_dir.h" |
41 | 43 | #include "olap/key_coder.h" |
42 | 44 | #include "olap/olap_common.h" |
@@ -196,7 +198,7 @@ Status SegmentWriter::init(const std::vector<uint32_t>& col_ids, bool has_key) { |
196 | 198 | if (_opts.compression_type == UNKNOWN_COMPRESSION) { |
197 | 199 | _opts.compression_type = _tablet_schema->compression_type(); |
198 | 200 | } |
199 | | - auto create_column_writer = [&](uint32_t cid, const auto& column) -> auto { |
| 201 | + auto create_column_writer = [&](uint32_t cid, const auto& column) -> auto{ |
200 | 202 | ColumnWriterOptions opts; |
201 | 203 | opts.meta = _footer.add_columns(); |
202 | 204 |
|
@@ -1056,6 +1058,14 @@ Status SegmentWriter::finalize_columns_data() { |
1056 | 1058 | } |
1057 | 1059 |
|
1058 | 1060 | Status SegmentWriter::finalize_columns_index(uint64_t* index_size) { |
| 1061 | + if (config::is_cloud_mode()) { |
| 1062 | + if (auto* s3_writer = dynamic_cast<io::S3FileWriter*>(_file_writer); s3_writer) { |
| 1063 | + s3_writer->mark_index_offset(); |
| 1064 | + } |
| 1065 | + if (auto* hdfs_writer = dynamic_cast<io::HdfsFileWriter*>(_file_writer); hdfs_writer) { |
| 1066 | + hdfs_writer->mark_index_offset(); |
| 1067 | + } |
| 1068 | + } |
1059 | 1069 | uint64_t index_start = _file_writer->bytes_appended(); |
1060 | 1070 | RETURN_IF_ERROR(_write_ordinal_index()); |
1061 | 1071 | RETURN_IF_ERROR(_write_zone_map()); |
|
0 commit comments