MCPcopy Create free account
hub / github.com/LadybugDB/ladybug / mapDummyScan

Method mapDummyScan

src/processor/map/map_dummy_scan.cpp:12–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10namespace processor {
11
12std::unique_ptr<PhysicalOperator> PlanMapper::mapDummyScan(const LogicalOperator*) {
13 auto inSchema = std::make_unique<Schema>();
14 auto expression = LogicalDummyScan::getDummyExpression();
15 auto tableSchema = FactorizedTableSchema();
16 // TODO(Ziyi): remove vectors when we have done the refactor of dataChunk.
17 std::vector<std::shared_ptr<ValueVector>> vectors;
18 std::vector<ValueVector*> vectorsToAppend;
19 auto columnSchema = ColumnSchema(false, 0 /* groupID */,
20 LogicalTypeUtils::getRowLayoutSize(expression->dataType));
21 tableSchema.appendColumn(std::move(columnSchema));
22 auto exprMapper = ExpressionMapper(inSchema.get());
23 auto expressionEvaluator = exprMapper.getEvaluator(expression);
24 auto memoryManager = storage::MemoryManager::Get(*clientContext);
25 // expression can be evaluated statically and does not require an actual resultset to init
26 expressionEvaluator->init(ResultSet(0) /* dummy resultset */, clientContext);
27 expressionEvaluator->evaluate();
28 vectors.push_back(expressionEvaluator->resultVector);
29 vectorsToAppend.push_back(expressionEvaluator->resultVector.get());
30 auto table = std::make_shared<FactorizedTable>(memoryManager, std::move(tableSchema));
31 table->append(vectorsToAppend);
32 return createEmptyFTableScan(table, 1 /* maxMorselSize */);
33}
34
35} // namespace processor
36} // namespace lbug

Callers

nothing calls this directly

Calls 10

ColumnSchemaClass · 0.85
ExpressionMapperClass · 0.85
ResultSetClass · 0.85
appendColumnMethod · 0.80
getEvaluatorMethod · 0.80
getMethod · 0.45
initMethod · 0.45
evaluateMethod · 0.45
push_backMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected