| 9 | namespace processor { |
| 10 | |
| 11 | FactorizedTableSchema FactorizedTableUtils::createFTableSchema(const expression_vector& exprs, |
| 12 | const Schema& schema) { |
| 13 | auto tableSchema = FactorizedTableSchema(); |
| 14 | std::unordered_set<common::idx_t> groupIDSet; |
| 15 | for (auto& e : exprs) { |
| 16 | auto groupPos = schema.getExpressionPos(*e).first; |
| 17 | auto group = schema.getGroup(groupPos); |
| 18 | if (group->isFlat()) { |
| 19 | auto column = |
| 20 | ColumnSchema(false, groupPos, LogicalTypeUtils::getRowLayoutSize(e->getDataType())); |
| 21 | tableSchema.appendColumn(std::move(column)); |
| 22 | } else { |
| 23 | auto column = ColumnSchema(true, groupPos, (uint32_t)sizeof(overflow_value_t)); |
| 24 | tableSchema.appendColumn(std::move(column)); |
| 25 | } |
| 26 | } |
| 27 | return tableSchema; |
| 28 | } |
| 29 | |
| 30 | FactorizedTableSchema FactorizedTableUtils::createFlatTableSchema( |
| 31 | std::vector<LogicalType> columnTypes) { |
nothing calls this directly
no test coverage detected