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

Using where clause on a date field #4853

Closed
ar-ms opened this issue Jul 6, 2022 · 2 comments
Closed

Using where clause on a date field #4853

ar-ms opened this issue Jul 6, 2022 · 2 comments
Labels
enhancement New feature proposal question The issue is a question. Please use Stack Overflow for questions.

Comments

@ar-ms
Copy link

ar-ms commented Jul 6, 2022

Problem

Hey folks 👋 ! Is there a way of querying a table using SQL with a where clause, date >= '2022-07-05' for example ?

I connected metabase to cube.js using the postgres connector, cube is plugged into BigQuery.

Related Cube.js schema

cube(`Cube`, {
  sql: `SELECT * FROM metrics.myTable`
    )}`,
  
  joins: {
    
  },
  
  measures: {

    count: {
      type: `count`,
      drillMembers: [uuid, date]
    },
    
    date: {
      sql: `date`,
      type: `time`
    },
  },

  dataSource: `default`
});

Metabase query

SELECT
    count
FROM
    Cube
where
    date > '2022-07-05'

And got the following error message:

Error during processing PostgreSQL message: Internal(None): Execution error: Internal(None): Error: No matching signature for operator > for argument types: DATE, TIMESTAMP. Supported signature: ANY > ANY at [4:112] None None

The docs says the filtering works with >=, <=, > and <, seems like it does not work with dates.

Is there something similar to https://cube.dev/docs/query-format#filters-operators-in-date-range, in SQL query ?

Thanks ✌🏽 !

@ar-ms ar-ms added the question The issue is a question. Please use Stack Overflow for questions. label Jul 6, 2022
@paveltiunov paveltiunov added enhancement New feature proposal backend:cubesql labels Jul 8, 2022
@paveltiunov
Copy link
Member

@ar-ms We're working on Metabase support right now. More info here #3906 .

@paveltiunov
Copy link
Member

paveltiunov commented Jul 29, 2022

@ar-ms Metabase support has been shipped.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature proposal question The issue is a question. Please use Stack Overflow for questions.
Projects
None yet
Development

No branches or pull requests

2 participants