| 537 | } |
| 538 | |
| 539 | std::unique_ptr<MergeTreeReaderStream> makeTextIndexInputStream( |
| 540 | DataPartStoragePtr data_part_storage, |
| 541 | const String & stream_name, |
| 542 | const String & extension, |
| 543 | const MergeTreeReaderSettings & reader_settings) |
| 544 | { |
| 545 | static constexpr size_t marks_count = 1; |
| 546 | |
| 547 | /// Check for both original and hashed filenames (hashed if the index name is too long) |
| 548 | auto actual_stream_name = IMergeTreeDataPart::getStreamNameOrHash(stream_name, extension, *data_part_storage); |
| 549 | if (!actual_stream_name) |
| 550 | throw Exception(ErrorCodes::FILE_DOESNT_EXIST, "File for text index stream {} does not exist", stream_name + extension); |
| 551 | |
| 552 | /// Use reader stream that doesn't read marks, |
| 553 | /// because text index always has one mark. |
| 554 | return std::make_unique<MergeTreeReaderStreamSingleColumnWholePart>( |
| 555 | data_part_storage, |
| 556 | *actual_stream_name, |
| 557 | extension, |
| 558 | marks_count, |
| 559 | MarkRanges{{0, marks_count}}, |
| 560 | reader_settings, |
| 561 | /*uncompressed_cache=*/ nullptr, |
| 562 | data_part_storage->getFileSize(*actual_stream_name + extension), |
| 563 | /*marks_loader=*/ nullptr, |
| 564 | ReadBufferFromFileBase::ProfileCallback{}, |
| 565 | CLOCK_MONOTONIC_COARSE); |
| 566 | } |
| 567 | |
| 568 | } |
no test coverage detected