| 279 | } |
| 280 | |
| 281 | static FactorizedTableSchema getFactorizedTableSchema(const expression_vector& flatKeys, |
| 282 | const expression_vector& unFlatKeys, const expression_vector& payloads, |
| 283 | const std::vector<AggregateFunction>& aggregateFunctions) { |
| 284 | auto isUnFlat = false; |
| 285 | auto groupID = 0u; |
| 286 | auto tableSchema = FactorizedTableSchema(); |
| 287 | for (auto& flatKey : flatKeys) { |
| 288 | auto size = LogicalTypeUtils::getRowLayoutSize(flatKey->dataType); |
| 289 | tableSchema.appendColumn(ColumnSchema(isUnFlat, groupID, size)); |
| 290 | } |
| 291 | for (auto& unFlatKey : unFlatKeys) { |
| 292 | auto size = LogicalTypeUtils::getRowLayoutSize(unFlatKey->dataType); |
| 293 | tableSchema.appendColumn(ColumnSchema(isUnFlat, groupID, size)); |
| 294 | } |
| 295 | for (auto& payload : payloads) { |
| 296 | auto size = LogicalTypeUtils::getRowLayoutSize(payload->dataType); |
| 297 | tableSchema.appendColumn(ColumnSchema(isUnFlat, groupID, size)); |
| 298 | } |
| 299 | for (auto& aggregateFunc : aggregateFunctions) { |
| 300 | tableSchema.appendColumn( |
| 301 | ColumnSchema(isUnFlat, groupID, aggregateFunc.getAggregateStateSize())); |
| 302 | } |
| 303 | tableSchema.appendColumn(ColumnSchema(isUnFlat, groupID, sizeof(hash_t))); |
| 304 | return tableSchema; |
| 305 | } |
| 306 | |
| 307 | std::unique_ptr<PhysicalOperator> PlanMapper::createDistinctHashAggregate( |
| 308 | const expression_vector& keys, const expression_vector& payloads, Schema* inSchema, |
no test coverage detected