cube-js / cube-js/cube

Pre-aggregations error - Error during upload (only in v0.33.29)

Open
#6,765 0 comments 2 reactions 0 assignees View on GitHub
question
Dominant language
Rust
Stars
20.8k
Forks
2.1k
Avg merge
1d 2h
Merged PRs (30d)
181

Description

**Describe the bug**
I wanted to try simple pre aggregation with this simple schema
```javascript
cube(`DimAttribute`, {
sql_table: `"Oee"."DimAttribute"`,
//data_source: `default`,
joins: {},
dimensions: {
id: {
sql: `${CUBE}."Id"`,
type: `number`,
primary_key: true
},
unsid: {
sql: `${CUBE}."UnsId"`,
type: `string`
},
AttributeId: {
sql: `${CUBE}."AttributeId"`,
type: `string`
},
assetid: {
sql: `${CUBE}."AssetId"`,
type: `string`
},
isvalid: {
sql: `${CUBE}."IsValid"`,
type: `string`
},
attributenamecscz: {
sql: `${CUBE}."AttributeNameCsCz"`,
type: `string`
},
attributenameengb: {
sql: `${CUBE}."AttributeNameEnGb"`,
type: `string`
},
assetnamecscz: {
sql: `${CUBE}."AssetNameCsCz"`,
type: `string`
},
assetnameengb: {
sql: `${CUBE}."AssetNameEnGb"`,
type: `string`
}
},
measures: {
count: {
type: `count`
}
},

pre_aggregations: {
main: {
measures: [CUBE.count]
}
}
});
```

But getting this error
![image](https://github.com/cube-js/cube/assets/40229516/c2755022-4c9d-4a2d-8f96-bc7948d8bb8e)

When not using pre aggregation part, it works smooth

EDIT

I checked it with older syntax
```javascript
cube(`DimAttribute`, {
sql: `Select *
FROM [Sidas3Reporting].[Oee].[DimAttribute]`,
//data_source: `default`,
joins: {},
dimensions: {
id: {
sql: `${CUBE}."Id"`,
type: `number`,
primary_key: true
},
unsid: {
sql: `${CUBE}."UnsId"`,
type: `string`
},
AttributeId: {
sql: `${CUBE}."AttributeId"`,
type: `string`
},
assetid: {
sql: `${CUBE}."AssetId"`,
type: `string`
},
isvalid: {
sql: `${CUBE}."IsValid"`,
type: `string`
},
attributenamecscz: {
sql: `${CUBE}."AttributeNameCsCz"`,
type: `string`
},
attributenameengb: {
sql: `${CUBE}."AttributeNameEnGb"`,
type: `string`
},
assetnamecscz: {
sql: `${CUBE}."AssetNameCsCz"`,
type: `string`
},
assetnameengb: {
sql: `${CUBE}."AssetNameEnGb"`,
type: `string`
}
},
measures: {
count: {
type: `count`
}
},

preAggregations: {
main: {
measures: [DimAttribute.count]
}
}
});
```

And **this works in v0.32.22** but not in **0.33.29**

**Version:**
0.33.29 - latest

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.