{"record":{"id":"15fa4b1e08e4a38b","repo":"perspective-dev/perspective","slug":"unknown-type-name-15fa4b","errorCode":null,"errorMessage":"Unknown type '{name}'","messagePattern":"Unknown type '(.+?)'","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"rust/perspective-python/perspective/virtual_servers/clickhouse.py","lineNumber":260,"sourceCode":"        name = name[9:-1]\n\n    if name.startswith(\"Array\"):\n        return \"string\"\n\n    if name in (\"Int64\", \"UInt64\", \"Float64\"):\n        return \"float\"\n\n    if name == \"String\":\n        return \"string\"\n\n    if name == \"DateTime\":\n        return \"datetime\"\n\n    if name == \"Date\":\n        return \"date\"\n\n    msg = f\"Unknown type '{name}'\"\n    raise ValueError(msg)\n\n\ndef run_query(db, query, execute=False, columns=False):\n    query = \" \".join(query.split())\n    start = datetime.now()\n    result = None\n    try:\n        if execute:\n            db.command(query)\n        else:\n            req = db.query(query)\n            result = req.result_rows\n    except Exception as e:\n        logger.error(e)\n        logger.error(f\"{query}\")\n        raise e\n    else:\n        logger.debug(f\"{datetime.now() - start} {query}\")","sourceCodeStart":242,"sourceCodeEnd":278,"githubUrl":"https://github.com/perspective-dev/perspective/blob/11c8238c0c9c0b9e490b5a6a2dc277afad1e980a/rust/perspective-python/perspective/virtual_servers/clickhouse.py#L242-L278","documentation":"clickhouse_type_to_psp maps ClickHouse column type names to Perspective type strings ('date', 'datetime', string, float, etc.). It raises ValueError when it encounters a ClickHouse type name it does not recognize, so schema construction, expression validation, or data fetch for a table with that column type fails.","triggerScenarios":"Creating a Perspective table/view over ClickHouse data whose schema contains an unmapped ClickHouse type (e.g. Enum8, Array, Nullable variants, UUID, or a version-specific type name) — reached via table_schema, table_validate_expression, or view_get_data.","commonSituations":"Querying ClickHouse tables with advanced/region-specific column types; ClickHouse server version differences introducing new type names; using the ClickHouse virtual server against tables with Array/Enum columns.","solutions":["Identify the offending column from the error's type name and cast it in the query to a supported type (e.g. toString(col), toDate(col)) before it reaches Perspective","Update/patch clickhouse_type_to_psp in perspective/virtual_servers/clickhouse.py to map the new type to the appropriate Perspective type","Pin/align the ClickHouse server version with one whose type names the connector recognizes"],"exampleFix":"# before\nSELECT * FROM my_table\n// after\nSELECT toString(enum_col) AS enum_col, arrayJoin(arr_col) AS arr_col FROM my_table","handlingStrategy":"try-catch","validationCode":"# Before creating a table/view, check the ClickHouse schema types:\nallowed = {\"String\",\"Float64\",\"Int64\",\"UInt64\",\"Date\",\"DateTime\"}\nschema = run_clickhouse(\"DESCRIBE TABLE my_table\")\nunsupported = [row.type for row in schema if row.type not in allowed]\nif unsupported:\n    print(\"Cast these columns in the query:\", unsupported)","typeGuard":null,"tryCatchPattern":"try:\n    table = client.table(query, db)\nexcept ValueError as e:\n    if str(e).startswith(\"Unknown type '\"):\n        bad = str(e).split(\"'\")[1]\n        query = query.replace(bad, f\"toString({bad})\")\n        table = client.table(query, db)\n    else:\n        raise","preventionTips":["Cast exotic ClickHouse columns (Enum, Array, UUID, Nullable) to basic types in your query","Check the ClickHouse table schema with DESCRIBE before wiring it into Perspective","Keep the perspective ClickHouse connector updated for newer server type names","Pin a ClickHouse server version compatible with the connector's type map"],"tags":["clickhouse","type-mapping","schema"],"backgroundTag":"invalid-enum-value","analyzedSha":"11c8238c0c9c0b9e490b5a6a2dc277afad1e980a","analyzedAt":"2026-09-09T00:35:19.377Z","contentChangedAt":"2026-09-09T00:35:19.377Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}