From 60a9cfc9aba853f16bd27a48dc2d2f8f41bf7a84 Mon Sep 17 00:00:00 2001 From: Igor Lukanin Date: Wed, 10 Jun 2026 14:18:57 +0200 Subject: [PATCH] fix(schema-compiler): use ClickHouse String type in Tesseract casts (#10316) --- .../cubejs-schema-compiler/src/adapter/ClickHouseQuery.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/cubejs-schema-compiler/src/adapter/ClickHouseQuery.ts b/packages/cubejs-schema-compiler/src/adapter/ClickHouseQuery.ts index 99b4f100c45bc..1e9636a3ce0af 100644 --- a/packages/cubejs-schema-compiler/src/adapter/ClickHouseQuery.ts +++ b/packages/cubejs-schema-compiler/src/adapter/ClickHouseQuery.ts @@ -273,6 +273,10 @@ export class ClickHouseQuery extends BaseQuery { templates.quotes.escape = '\\`'; templates.types.boolean = 'BOOL'; templates.types.timestamp = 'DATETIME'; + // ClickHouse's string type is `String` (case-sensitive); the base `STRING` is invalid. + // The legacy planner avoids this via castToString(), but Tesseract renders the types.string + // template directly, so it must be overridden here. See cube-js/cube#10316. + templates.types.string = 'String'; delete templates.types.time; // ClickHouse intervals have a distinct type for each granularity delete templates.types.interval;