Closed pauldheinrichs closed 1 day ago
Hi @pauldheinrichs. Big thanks for a detailed report.
I managed to simplify query to this in our data model for unit tests:
SELECT
customer_gender
FROM KibanaSampleDataEcommerce
WHERE
order_date >= NOW()
AND
LOWER(customer_gender) = 'foo'
;
It breaks with same Can't generate SQL for literal: TimestampNanosecond(..., Some(\"UTC\")).
.
I need a bit more time to find the culprit.
Localized the issue, it's a combination of NOW()
and SQL pushdown query.
Constant folding at late stage evaluates NOW()
with DataFusion, and turns it into ScalarValue::TimestampNanosecond(..., Some("UTC"))
, and this breaks later during SQL generation for pushdown.
Both NOW
and pushdown are important here, which is why when you removed either WHERE
(that had NOW()
) or count(distinct dimension)
(that triggered pushdown) it worked. In my example LOWER(dimension)
triggered pushdown.
I've just merged #8971, should be fixed in next release. I'll ping again when release is ready.
v1.1.7 was just released, it's already available on Docker Hub, soon will be on Cloud.
@mcheshkov Thanks for the quick turnaround here! Appreciate it
Describe the bug Queries generated via metabase are breaking pretty frequently past 1.1.4 when containing time clauses and groupings on time.
To Reproduce Steps to reproduce the behavior: 1: leverage the following cube in a postgres / redshift env
Minimally reproducible Cube Schema
The following queries fail
with
I have smoke tested the query in several ways and here are the outcomes when modifying
count(distinct some_val)
WHERE
clausecount distinct
tocount
DATE_TRUNC('week', "public"."test_cube"."day_one")
Some failing examples
Some passing example queries from the above chart