{"record":{"id":"d04a7dd82dd12263","repo":"pathwaycom/pathway","slug":"column-name-s-sorted-reserved-r-collide-with-t","errorCode":null,"errorMessage":"Column name(s) {sorted(reserved)!r} collide with the reserved {sorted(metadata_columns)!r} metadata columns appended by pw.io.clickhouse.write. Rename the column(s) in your schema before writing.","messagePattern":"Column name\\(s\\) (.+?) collide with the reserved (.+?) metadata columns appended by pw\\.io\\.clickhouse\\.write\\. Rename the column\\(s\\) in your schema before writing\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/pathway/io/clickhouse/__init__.py","lineNumber":238,"sourceCode":"\n    Because the deduplication happens during background merges, query the snapshot\n    with ``FINAL`` to always observe the current state:\n\n    .. code-block:: bash\n\n        curl 'http://localhost:8123/?query=SELECT%20name,owner%20FROM%20pets%20FINAL'\n    \"\"\"\n    _check_entitlements(\"clickhouse\")\n\n    is_snapshot_mode = output_table_type == SNAPSHOT_OUTPUT_TABLE_TYPE\n\n    column_names = set(table.schema.column_names())\n    metadata_columns = (\n        {\"version\", \"is_deleted\"} if is_snapshot_mode else {\"time\", \"diff\"}\n    )\n    reserved = metadata_columns & column_names\n    if reserved:\n        raise ValueError(\n            f\"Column name(s) {sorted(reserved)!r} collide with the reserved \"\n            f\"{sorted(metadata_columns)!r} metadata columns appended by \"\n            \"pw.io.clickhouse.write. Rename the column(s) in your schema before writing.\"\n        )\n    key_field_names: list[str] | None = None\n    if is_snapshot_mode:\n        if primary_key is None or not list(primary_key):\n            raise ValueError(\n                \"output_table_type='snapshot' requires the primary_key parameter: \"\n                \"pass the column(s) that identify each row so the connector can \"\n                \"maintain the current snapshot keyed by them.\"\n            )\n        key_field_names = [column.name for column in primary_key]\n    elif primary_key is not None:\n        raise ValueError(\n            \"The primary_key parameter is only used with output_table_type='snapshot'; \"\n            \"remove it or set output_table_type='snapshot'.\"\n        )","sourceCodeStart":220,"sourceCodeEnd":256,"githubUrl":"https://github.com/pathwaycom/pathway/blob/fa2f74a4649b7c5908690cf60137263d8d80de5f/python/pathway/io/clickhouse/__init__.py#L220-L256","documentation":"Error \"Column name(s) {sorted(reserved)!r} collide with the reserved {sorted(metadata_columns)!r} metadata columns appended by pw.io.clickhouse.write. Rename the column(s) in your schema before writing.\" thrown in pathwaycom/pathway.","triggerScenarios":"Thrown at python/pathway/io/clickhouse/__init__.py:238 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Rename the colliding columns before writing, e.g. via table.select(new_name=t.old_name)."],"exampleFix":"t = t.select(*pw.this.without('time'), ts=t.time); pw.io.clickhouse.write(t, ...)","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fa2f74a4649b7c5908690cf60137263d8d80de5f","analyzedAt":"2026-08-15T01:48:17.006Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}