| 10 | namespace processor { |
| 11 | |
| 12 | std::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 |
nothing calls this directly
no test coverage detected