cube-js/cube

Adding offset attribute to the query leads to fatal error

Open

#6.880 geöffnet am 13. Juli 2023

Auf GitHub ansehen
 (2 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Rust (1.965 Forks)batch import
driver:elasticsearchhelp wanted

Repository-Metriken

Stars
 (19.563 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 5T 16h) (138 gemergte PRs in 30 T)

Beschreibung

Describe the bug In order to enable pagination we are trying to use offset and limit, but as soon as I am adding the "offset" attribute to the query dictionary the cubejs is responding with an error message. This is a BLOCKER issue for our production release.

To Reproduce Steps to reproduce the behavior:

  1. Run CubeJS rest api with the following payload: {"measures":["items.count"],"timeDimensions":[{"dimension":"items.created_on","granularity":"year"}],"dimensions":["items.id","items.created_on"],"limit":3,"offset":1,"order":[["items.modified_on","asc"]]}

Expected behavior It should respond with proper results with the offsets attribute in action.

Minimally reproducible Cube Schema Cube data backend: ELASTIC SEARCH

cube(`items`, {
  sql_table: `items`,
  
  data_source: `default`,
  
  joins: {
    
  },
  
  dimensions: {
    id: {
      sql: `id`,
      type: `string`,
      primary_key: true
    },
    email: {
      sql: `email`,
      type: `string`
    },
    
    name: {
      sql: `name`,
      type: `string`
    },
    
    created_on: {
      sql: `created_on`,
      type: `time`
    },
    
    modified_on: {
      sql: `modified_on`,
      type: `time`
    }
  },
  
  measures: {
    count: {
      type: `count`
    }
  },
  
  pre_aggregations: {
    // Pre-aggregation definitions go here.
    // Learn more in the documentation: https://cube.dev/docs/caching/pre-aggregations/getting-started
  }
});

Version: 0.33.35

Contributor Guide