Panel of type table doesn't show all columns used in clickhouse query
jha-hitesh opened this issue · comments
Bug description
while creating a panel of type table in the dashboards section, table doesn't show all columns used in clickhouse query, this happens specifically if the column datatype is integer or float, if we cast the value to string it works.
Expected behavior
all columns irrespective of their data type should show in table
How to reproduce
- try this query in panel of type table,
SELECT name as table_name, database, ((total_bytes/1024)/1024) as value FROM system.tables ORDER BY value DESC
- the table will show only 2 columns
- now if you cast the value to string it will work
SELECT name as table_name, database, if(total_bytes>0,cast((total_bytes/1024)/1024, 'String'),'0') as value FROM system.tables ORDER BY value DESC
Version information
- Signoz version: 0.46.0
- Browser version: Version 126.0.6478.62 (Official Build) (arm64
- Your OS and version: macbook pro 14.2.1 (23C71
- Your CPU Architecture(ARM/Intel): ARM
Additional context
while checking the query service logs we get below stacktrace 5 to 6 times when executing the not working CH query
{ "level": "ERROR", "timestamp": "2024-06-20T17:31:21.968Z", "caller": "clickhouseReader/reader.go:4543", "msg": "unsupported var type found in query builder query result", "v": 124.10833358764648, "colName": "value", "stacktrace": "go.signoz.io/signoz/pkg/query-service/app/clickhouseReader.readRow\n\t/home/runner/work/signoz/signoz/pkg/query-service/app/clickhouseReader/reader.go:4543\ngo.signoz.io/signoz/pkg/query-service/app/clickhouseReader.readRowsForTimeSeriesResult\n\t/home/runner/work/signoz/signoz/pkg/query-service/app/clickhouseReader/reader.go:4584\ngo.signoz.io/signoz/pkg/query-service/app/clickhouseReader.(*ClickHouseReader).GetTimeSeriesResultV3\n\t/home/runner/work/signoz/signoz/pkg/query-service/app/clickhouseReader/reader.go:4660\ngo.signoz.io/signoz/pkg/query-service/app/querier/v2.(*querier).execClickHouseQuery\n\t/home/runner/work/signoz/signoz/pkg/query-service/app/querier/v2/querier.go:95\ngo.signoz.io/signoz/pkg/query-service/app/querier/v2.(*querier).runClickHouseQueries.func1\n\t/home/runner/work/signoz/signoz/pkg/query-service/app/querier/v2/querier.go:420" }
Thank you for your bug report – we love squashing them!
Thanks for opening this issue. A team member should give feedback soon. In the meantime, feel free to check out the contributing guidelines.