ivkhokhlachev commented on PR #38280: URL: https://github.com/apache/superset/pull/38280#issuecomment-4905339983
Looks like this change now brings problems due to a Clickhouse setting **prefer_column_name_to_alias** https://clickhouse.com/docs/operations/settings/settings#prefer_column_name_to_alias Its default value is 0, so "The column name is substituted with the alias." I'm now testing my charts on Superset 6.1.0 and this removal of random suffixes in column aliases leads to the scenario when applied Time Range filters implicitly depend on a Granularity filter. E.g. I set values in a Time Range filter: Start 2026-06-10 (which was Wednesday) - End 2026-07-08 **Actual Time Range**, as shown in a filter, is "2026-06-10 ≤ col < 2026-07-08", days of two months 1. I select Granularity="Day" Resulted query: ``` SELECT toDate("session_start_date_hour") AS "session_start_date_hour" ... WHERE "session_start_date_hour" >= toDateTime('2026-06-10 00:00:00') AND "session_start_date_hour" < toDateTime('2026-07-08 00:00:00') ``` Everything is ok. 2. I decide to change granularity of the results and select Granularity="Week" "Actual Time Range" still the same "2026-06-10 ≤ col < 2026-07-08", but the resulted query is: ``` SELECT dateTrunc('WEEK', toDate("session_start_date_hour")) AS "session_start_date_hour" ... WHERE "session_start_date_hour" >= toDateTime('2026-06-10 00:00:00') AND "session_start_date_hour" < toDateTime('2026-07-08 00:00:00') ``` Due to the prefer_column_name_to_alias=0, the minimal day, included into the results is 2026-06-15, and the whole week before that Monday disappears from the results, while I didn't touch Time Range filter and "Actual Time Range" still says me it should be there. 3. And the same for Granularity="Month" Resulted query: ``` SELECT dateTrunc('MONTH', toDate("session_start_date_hour")) AS "session_start_date_hour" ... WHERE "session_start_date_hour" >= toDateTime('2026-06-10 00:00:00') AND "session_start_date_hour" < toDateTime('2026-07-08 00:00:00') ``` So only results for July are shown. In Superset 4.1.2, which we have on prod now, there's no such issue, cause the resulted query is always like ``` SELECT dateTrunc('MONTH', toDate("session_start_date_hour")) AS "session_start_date_hour_a6264a" ... WHERE "session_start_date_hour" >= toDateTime('2026-06-10 00:00:00') AND "session_start_date_hour" < toDateTime('2026-07-08 00:00:00') ``` so dynamic column aliases do not affect filters. Did I miss anything about this update? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
