Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FILTER_PARAMS throws "Query parameter number 1 is not defined (0 provided)" error when used in refreshKey #8727

Open
itestyoy opened this issue Sep 19, 2024 · 2 comments

Comments

@itestyoy
Copy link

Hi! Pre-aggregations throw an error when we use FILTER_PARAMS in the refreshKey

Error:

cube  | Error: Query parameter number 1 is not defined (0 provided) at [3:63]
cube  |     at QueryQueue.parseResult (/cube/node_modules/@cubejs-backend/query-orchestrator/src/orchestrator/QueryQueue.js:394:13)
cube  |     at QueryQueue.executeInQueue (/cube/node_modules/@cubejs-backend/query-orchestrator/src/orchestrator/QueryQueue.js:366:19)
cube  |     at processTicksAndRejections (node:internal/process/task_queues:95:5)
cube  |     at PreAggregationLoadCache.keyQueryResult (/cube/node_modules/@cubejs-backend/query-orchestrator/src/orchestrator/PreAggregations.ts:439:75)
cube  |     at async Promise.all (index 0)
cube  |     at PreAggregationPartitionRangeLoader.loadRangeQuery (/cube/node_modules/@cubejs-backend/query-orchestrator/src/orchestrator/PreAggregations.ts:1573:38)
cube  |     at /cube/node_modules/@cubejs-backend/query-orchestrator/src/orchestrator/PreAggregations.ts:1879:11
cube  |     at async Promise.all (index 0)
cube  |     at PreAggregationPartitionRangeLoader.loadBuildRange (/cube/node_modules/@cubejs-backend/query-orchestrator/src/orchestrator/PreAggregations.ts:1876:36)
cube  |     at PreAggregationPartitionRangeLoader.partitionRanges (/cube/node_modules/@cubejs-backend/query-orchestrator/src/orchestrator/PreAggregations.ts:1835:24)
cube  |     at PreAggregationPartitionRangeLoader.partitionPreAggregations (/cube/node_modules/@cubejs-backend/query-orchestrator/src/orchestrator/PreAggregations.ts:1827:47)
cube  |     at async Promise.all (index 0)
cube  |     at PreAggregations.expandPartitionsInPreAggregations (/cube/node_modules/@cubejs-backend/query-orchestrator/src/orchestrator/PreAggregations.ts:2322:68)
cube  |     at OrchestratorApi.expandPartitionsInPreAggregations (/cube/node_modules/@cubejs-backend/server-core/src/core/OrchestratorApi.ts:277:14)
cube  |     at RefreshScheduler.refreshQueriesForPreAggregation (/cube/node_modules/@cubejs-backend/server-core/src/core/RefreshScheduler.ts:178:24)

Model:

cube('model', {
      public: false,
      title: 'model',
      sql: `select timestamp('2024-01-01') as created_at, 'hello' as dim, timestamp('2024-01-01') updated_at`,

      dimensions: {
          created_at: {
              sql: `created_at`,
              type: `time`
          },

          dim: {
              sql: `dim`,
              type: `string`
          }
      },

      measures: {
          metric: {
              sql: `(1)`,
              type: 'max'
          }
      },

      pre_aggregations: {
          model_0_0_rollup: {
              measures: [
                  CUBE.metric
              ],
              dimensions: [
                  CUBE.dim,
              ],
              time_dimension: CUBE.created_at,
              granularity: `day`,
              external: false,
              partition_granularity: `month`,
              refresh_key: {
                  sql: `SELECT max(updated_at)
                           FROM (select timestamp('2024-01-01') as created_at, 'hello' as dim, timestamp('2024-01-01') updated_at)
                        WHERE ${FILTER_PARAMS.model.created_at.filter("created_at")}`,
              },
          },
      }
});

Version:
0.36.0

@sanromeo
Copy link

Still present in 0.36.3

@sanromeo
Copy link

#8721 didn't solve problem for refresh_key in pre-aggregations :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants