ClickHouse / power-bi-clickhouse

This connector allows you to retrieve data from ClickHouse directly into Power BI for analysis and visualization
Apache License 2.0
46 stars 1 forks source link

PowerBI Desktop - Direct Query - Table - Generates invalid nested SQL with overlapping aliases #20

Closed GithubUser5462 closed 3 months ago

GithubUser5462 commented 8 months ago

Describe the bug Table visualization generates broken SQL.

To Reproduce In clickhouse create a table with multiple numeric columns (int64, float64) and import it as direct query in powerbi. In powerbi add a table visualization and add multiple columns to it. Initially it works fine, but eventually it starts nesting the query and assigning aliases like C1, C2, C3,... which overlap. This causes errors "aggregate function found inside another aggregate function" and "cyclic alias".

Example of generated query:

SELECT sum(CAST(C2, 'DOUBLE')) AS C1, sum(CAST(C1, 'DOUBLE')) AS C2
FROM (SELECT CAST(round(CAST(impressions, 'DOUBLE'), _CAST(0, 'Nullable(Int32)')), 'BIGINT') AS C1, CAST(round(CAST(inviews, 'DOUBLE'), _CAST(0, 'Nullable(Int32)')), 'BIGINT') AS C2 FROM ...

Configuration

BentsiLeviav commented 7 months ago

Thank you for your feedback!

Could you be more precise? Did you do something actively before getting this error? If possible, could you add precise steps to reproduce the issue? I couldn't produce it with your current explanation.

UnamedRus commented 5 months ago

https://github.com/ClickHouse/ClickHouse/issues/26674

GithubUser5462 commented 3 months ago

Got the chance to update my clickhouse instance and it seems to be fixed, thank you.