File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2424#include < Parsers/ASTLiteral.h>
2525#include " StorageLogSettings.h"
2626#include < Processors/Sources/SourceWithProgress.h>
27+ #include < Processors/Sources/NullSource.h>
2728#include < Processors/Pipe.h>
2829#include < Processors/Sinks/SinkToStorage.h>
2930
@@ -122,9 +123,6 @@ Chunk LogSource::generate()
122123 if (rows_read == rows_limit)
123124 return {};
124125
125- if (storage.file_checker .empty ())
126- return {};
127-
128126 // / How many rows to read for the next block.
129127 size_t max_rows_to_read = std::min (block_size, rows_limit - rows_read);
130128 std::unordered_map<String, ISerialization::SubstreamsCache> caches;
@@ -672,6 +670,9 @@ Pipe StorageLog::read(
672670 if (!lock)
673671 throw Exception (" Lock timeout exceeded" , ErrorCodes::TIMEOUT_EXCEEDED);
674672
673+ if (file_checker.empty ())
674+ return Pipe (std::make_shared<NullSource>(metadata_snapshot->getSampleBlockForColumns (column_names, getVirtuals (), getStorageID ())));
675+
675676 Pipes pipes;
676677
677678 const Marks & marks = getMarksWithRealRowCount (metadata_snapshot);
Original file line number Diff line number Diff line change @@ -98,9 +98,6 @@ class StripeLogSource final : public SourceWithProgress
9898protected:
9999 Chunk generate () override
100100 {
101- if (storage.file_checker .empty ())
102- return {};
103-
104101 Block res;
105102 start ();
106103
@@ -337,7 +334,7 @@ Pipe StorageStripeLog::read(
337334 Pipes pipes;
338335
339336 String index_file = table_path + " index.mrk" ;
340- if (!disk->exists (index_file))
337+ if (file_checker. empty () || !disk->exists (index_file))
341338 {
342339 return Pipe (std::make_shared<NullSource>(metadata_snapshot->getSampleBlockForColumns (column_names, getVirtuals (), getStorageID ())));
343340 }
You can’t perform that action at this time.
0 commit comments