Skip to content

Commit 8c8a287

Browse files
committed
Change name to be gadget specific
1 parent 7cd7e86 commit 8c8a287

3 files changed

Lines changed: 6 additions & 4 deletions

File tree

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"name": "clickhouse-datasource",
2+
"name": "gadget-clickhouse-datasource",
33
"version": "4.11.4",
4-
"description": "Clickhouse Datasource",
4+
"description": "Gadget Clickhouse Datasource",
55
"engines": {
66
"node": ">=20"
77
},

src/components/queryBuilder/views/traceQueryBuilderHooks.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,13 @@ export const useColumnTypes = (
156156
});
157157

158158
// Auto-detect JSON attributes
159-
let detectedJsonAttributes = true;
159+
let detectedJsonAttributes = false;
160160
if (!useJsonAttributes) {
161161
const tagsCol = updatedColumns.find((c) => c.hint === ColumnHint.TraceTags);
162162
const serviceTagsCol = updatedColumns.find((c) => c.hint === ColumnHint.TraceServiceTags);
163163

164+
console.log('tagsCol', tagsCol);
165+
console.log('serviceTagsCol', serviceTagsCol);
164166
detectedJsonAttributes =
165167
tagsCol?.type?.toLowerCase().startsWith('json') ||
166168
serviceTagsCol?.type?.toLowerCase().startsWith('json') ||

src/data/sqlGenerator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,7 @@ export const getAttributesSelectSql = (columnIdentifier: string, columnType: str
687687
if (isJsonType) {
688688
// For native JSON columns (ClickHouse 25.x+), convert to string first then extract keys/values.
689689
// Native JSON can be used directly in Grafana.
690-
return `arrayMap(tuple -> map('key', tuple.1, 'value', toString(tuple.2)), JSONExtractKeysAndValuesRaw(toString(${columnIdentifier}))) as ${alias}`;
690+
return `arrayMap(tuple -> map('key', tuple.1, 'value', tuple.2), JSONExtractKeysAndValuesRaw(toJSONString(${columnIdentifier}))) as ${alias}`;
691691
}
692692

693693
// Default: Map type - convert to array of {key, value} maps for Grafana trace panel

0 commit comments

Comments
 (0)