cube
cube copied to clipboard
When a cube is connected in postgresql mode, the time interval is a problem when sql uses date filtering
Describe the bug When a cube is connected in postgresql mode, the time interval is a problem when sql uses date filtering
To Reproduce Steps to reproduce the behavior:
- If my sql looks like this:
select name FROM public.my_table
WHERE channel IN ('WX')
AND order_date >= TO_TIMESTAMP('2023-12-04 00:00:00.000000', 'YYYY-MM-DD HH24:MI:SS.US')
AND order_date < TO_TIMESTAMP('2024-01-04 00:00:00.000000', 'YYYY-MM-DD HH24:MI:SS.US')
I will get this json Query, and it does not include the time 2023-12-04T00:00:00.000Z
"filters": [
{
"member": "my_table.channel",
"operator": "equals",
"values": [
"WX"
]
},
{
"member": "my_table.order_date",
"operator": "afterDate",
"values": [
"2023-12-04T00:00:00.000Z"
]
},
{
"member": "my_table.order_date",
"operator": "beforeDate",
"values": [
"2024-01-03T23:59:59.999Z"
]
}
]
- If my sql looks like this: (I just adjusted the position of the channel IN ('WX') statement)
select name FROM public.my_table
WHERE
order_date >= TO_TIMESTAMP('2023-12-04 00:00:00.000000', 'YYYY-MM-DD HH24:MI:SS.US')
AND order_date < TO_TIMESTAMP('2024-01-04 00:00:00.000000', 'YYYY-MM-DD HH24:MI:SS.US')
and channel IN ('WX')
I will get this json Query, and it does include the time 2023-12-04T00:00:00.000Z
"timeDimensions": [
{
"dimension": "my_table.order_date",
"dateRange": [
"2023-12-04T00:00:00.000Z",
"2024-01-03T23:59:59.999Z"
]
}
],
"filters": [
{
"member": "my_table.channel",
"operator": "equals",
"values": [
"WX"
]
}
]
Expected behavior A clear and concise description of what you expected to happen.
Screenshots Because I have a lot of data that happens at 0 am, this bug causes my data to be inconsistent frequently. I want a uniform treatment of this threshold
Minimally reproducible Cube Schema
Version: V0.34.41
Thanks for reporting this, @sjq1271227116! Let me tag @ovr and @paveltiunov so they might take a look as well.
A quick follow up question—are you a Cube Cloud user as well?
A quick follow up question—are you a Cube Cloud user as well?
Yes, I used postgresql to connect to the cube cloud and had no problem
A quick follow up question—are you a Cube Cloud user as well?
Yes, I used postgresql to connect to the cube cloud and had no problem
This problem only occurs with the cube core
This problem only occurs with the cube core
@sjq1271227116 Oh, this is interesting! Which version of Cube do you have in Cube Cloud? You can look it up in the API instance logs under Resources on the Overview page.
This problem only occurs with the cube core
@sjq1271227116 Oh, this is interesting! Which version of Cube do you have in Cube Cloud? You can look it up in the API instance logs under Resources on the Overview page.
0.34.34
Fixed in latest