MCPcopy Create free account
hub / github.com/ByConity/ByConity / generateStep

Method generateStep

src/QueryPlan/PlanSegmentSourceStep.cpp:64–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62}
63
64QueryPlanStepPtr PlanSegmentSourceStep::generateStep()
65{
66 StoragePtr storage = DatabaseCatalog::instance().getTable({storage_id.database_name, storage_id.table_name}, context);
67 auto storage_snapshot = storage->getStorageSnapshot(storage->getInMemoryMetadataPtr(), context);
68
69 auto pipe = storage->read(column_names,
70 storage_snapshot,
71 query_info,
72 context,
73 processed_stage,
74 max_block_size,
75 num_streams);
76
77 if (pipe.empty())
78 {
79 auto header = storage->getInMemoryMetadataPtr()->getSampleBlockForColumns(column_names, storage->getVirtuals(), storage_id);
80 auto null_pipe = InterpreterSelectQuery::generateNullSourcePipe(header, query_info);
81 auto read_from_pipe = std::make_unique<ReadFromPreparedSource>(std::move(null_pipe));
82 read_from_pipe->setStepDescription("Read from NullSource");
83 return read_from_pipe;
84 }
85 else
86 return std::make_unique<ReadFromStorageStep>(std::move(pipe), step_description);
87}
88
89std::shared_ptr<IQueryPlanStep> PlanSegmentSourceStep::copy(ContextPtr) const
90{

Callers

nothing calls this directly

Calls 8

setStepDescriptionMethod · 0.80
getTableMethod · 0.45
getStorageSnapshotMethod · 0.45
readMethod · 0.45
emptyMethod · 0.45
getVirtualsMethod · 0.45

Tested by

no test coverage detected