Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore: fix Clickhouse JSON query display (#16685)

Vincent Huangc9df5abbabd6
diff --git a/backend/plugin/db/clickhouse/query.go b/backend/plugin/db/clickhouse/query.go
index dadfa1a2f9..713c3f0139 100644
--- a/backend/plugin/db/clickhouse/query.go
+++ b/backend/plugin/db/clickhouse/query.go
@@ -103,8 +103,8 @@ func getStatementWithResultLimit(statement string, limit int) string {
}
func makeValueByTypeName(typeName string, columnType *sql.ColumnType) any {
- if strings.HasPrefix(typeName, "TUPLE") || strings.HasPrefix(typeName, "ARRAY") || strings.HasPrefix(typeName, "MAP") {
- // For TUPLE, ARRAY, MAP type in ClickHouse, we pass any and the driver will do the rest.
+ if strings.HasPrefix(typeName, "TUPLE") || strings.HasPrefix(typeName, "ARRAY") || strings.HasPrefix(typeName, "MAP") || strings.HasPrefix(typeName, "JSON") {
+ // For TUPLE, ARRAY, MAP, JSON type in ClickHouse, we pass any and the driver will do the rest.
var it any
return &it
}
@@ -114,7 +114,7 @@ func makeValueByTypeName(typeName string, columnType *sql.ColumnType) any {
}
func convertValue(_ string, _ *sql.ColumnType, value any) *v1pb.RowValue {
- // handle TUPLE ARRAY MAP
+ // handle TUPLE ARRAY MAP JSON
if v, ok := value.(*any); ok && v != nil {
value, err := json.Marshal(v)
if err != nil {