cube icon indicating copy to clipboard operation
cube copied to clipboard

Getting Unsupported filter scalar: int32(3) while executing query which filters dayofweek

Open anshjain18 opened this issue 1 year ago • 4 comments

Failed SQL

select
  'b2c_orders' as metric_name,
  measure(b2c_orders) as metric_value,
  date_trunc('week', time) as time
from product_revenue 
where dayofweek <= EXTRACT(DOW from current_date)
GROUP by 1,3

Logical Plan Not able to get the logical plan, getting the same error while appending "explain" keyword to the query.

Error postgresql error: Error during rewrite: Unexpected panic. Reason: Unsupported filter scalar: Int32(4). Please check logs for additional information.

Version: 0.34.36

Additional context

  1. dayofweek is a simple dimension of type number in the cube 'product_revenue'
  2. If I use a constant value on the either side of the filter, for eg: '2 <= EXTRACT(DOW from current_date)', or 'dayofweek <= 2', it works just fine.

anshjain18 avatar Jan 04 '24 06:01 anshjain18

Hi @anshjain18 👋 Thanks for reporting this! I haven't been able to find a workaround yet. Cc'ing @ovr and @paveltiunov so they might take a look.

igorlukanin avatar Jan 04 '24 10:01 igorlukanin

If you are interested in working on this issue, please leave a comment below and we will be happy to assign the issue to you. If this is the first time you are contributing a Pull Request to Cube.js, please check our contribution guidelines. You can also post any questions while contributing in the #contributors channel in the Cube.js Slack.

github-actions[bot] avatar Jan 10 '24 00:01 github-actions[bot]

Hey @igorlukanin @paveltiunov , can u please confirm if there is any update on this..

anshjain18 avatar Feb 04 '24 19:02 anshjain18