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

Method createFTableSchema

src/processor/result/factorized_table_util.cpp:11–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9namespace processor {
10
11FactorizedTableSchema 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
30FactorizedTableSchema FactorizedTableUtils::createFlatTableSchema(
31 std::vector<LogicalType> columnTypes) {

Callers

nothing calls this directly

Calls 6

ColumnSchemaClass · 0.85
getDataTypeMethod · 0.80
appendColumnMethod · 0.80
getExpressionPosMethod · 0.45
getGroupMethod · 0.45
isFlatMethod · 0.45

Tested by

no test coverage detected