Skip to content

When using a custom SQL refreshKey with an updateWindow, schema fails to compile #3585

@bgiles28

Description

@bgiles28

Describe the Problem
We have a custom SQL refreshKey ( SELECT DATEDIFF(SECOND, '19700101', sysutcdatetime()) / (606024) ) and when I try to add an updateWindow, I get the following compile errors which aren't very clear:

Error: Compile errors:
Main cube: (preAggregations.monthlyAggregation.refreshKey.updateWindow = ) is not allowed
at ErrorReporter.throwIfAny (/home/bgiles/main.cubejs/node_modules/@cubejs-backend/schema-compiler/src/compiler/ErrorReporter.ts:127:13)
at DataSchemaCompiler.throwIfAnyErrors (/home/bgiles/main.cubejs/node_modules/@cubejs-backend/schema-compiler/src/compiler/DataSchemaCompiler.js:147:23)
at /home/bgiles/main.cubejs/node_modules/@cubejs-backend/schema-compiler/src/compiler/DataSchemaCompiler.js:67:16
at CompilerApi.metaConfig (/home/bgiles/main.cubejs/node_modules/@cubejs-backend/server-core/src/core/CompilerApi.js:142:13)
at ApiGateway.meta (/home/bgiles/main.cubejs/node_modules/@cubejs-backend/api-gateway/src/gateway.ts:474:26)
at /home/bgiles/main.cubejs/node_modules/@cubejs-backend/api-gateway/src/gateway.ts:319:7

Is the intent that if you have a custom SQL refreshKey that you are unable to use other refreshKey parameters like updateWindow, incremental, etc.? If so, this is not clear in the documentation or the error logging.

To Reproduce
monthlyAggregation: {
refreshKey: {
sql: SELECT DATEDIFF(SECOND, '19700101', sysutcdatetime()) / (60*60*24)
updateWindow: 12 week
incremental: true
},
type: rollup,
external: true,
scheduledRefresh: true,
measureReferences: [],
dimensionReferences: [],
timeDimensionReference: ,
granularity: month,
partitionGranularity: quarter,
buildRangeStart: {
sql: SELECT CAST('2020-10-01' AS DATETIME2)
},
buildRangeEnd: {
sql: Select GETDATE()
}

Version:
"@cubejs-backend/cubestore-driver": "0.28.49",
"@cubejs-backend/mssql-driver": "0.28.47",
"@cubejs-backend/server": "0.28.49"

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionThe issue is a question. Please use Stack Overflow for questions.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions