{"record":{"id":"3c663303cd943dda","repo":"apache/seatunnel","slug":"get-part-error","errorCode":"GET_PART_ERROR","errorMessage":"Cannot get part name from system.parts","messagePattern":"Cannot get part name from system\\.parts","errorType":"error_code","errorClass":"ClickhouseConnectorException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-clickhouse/src/main/java/org/apache/seatunnel/connectors/seatunnel/clickhouse/util/ClickhouseProxy.java","lineNumber":471,"sourceCode":"\n        if (partitionList != null && !partitionList.isEmpty()) {\n            StringJoiner joiner = new StringJoiner(\"', '\", \"('\", \"')\");\n            partitionList.forEach(joiner::add);\n\n            sql += \" and partition in \" + joiner.toString();\n        }\n\n        sql += \" group by name\";\n\n        log.debug(\"get part sql: {}\", sql);\n\n        try (ClickHouseResponse response = clickhouseRequest.query(sql).executeAndWait()) {\n            Iterable<ClickHouseRecord> records = response.records();\n            return StreamSupport.stream(records.spliterator(), false)\n                    .map(r -> new ClickhousePart(r.getValue(0).asString(), database, table, shard))\n                    .collect(Collectors.toList());\n        } catch (ClickHouseException e) {\n            throw new ClickhouseConnectorException(\n                    ClickhouseConnectorErrorCode.GET_PART_ERROR,\n                    \"Cannot get part name from system.parts\",\n                    e);\n        }\n    }\n\n    public List<SeaTunnelRow> batchFetchRecords(\n            String sql, TablePath tablePath, SeaTunnelRowType seaTunnelRowType) {\n        List<SeaTunnelRow> seaTunnelRowList = new ArrayList<>();\n        log.debug(\"run query data sql: {}\", sql);\n\n        try (ClickHouseResponse response = clickhouseRequest.query(sql).executeAndWait()) {\n            response.stream()\n                    .forEach(\n                            record -> {\n                                SeaTunnelRow seaTunnelRow =\n                                        ClickhouseUtil.convertToSeaTunnelRow(\n                                                record, seaTunnelRowType, tablePath.getFullName());","sourceCodeStart":453,"sourceCodeEnd":489,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-clickhouse/src/main/java/org/apache/seatunnel/connectors/seatunnel/clickhouse/util/ClickhouseProxy.java#L453-L489","documentation":"ClickhouseProxy.getPartList queries system.parts to enumerate data parts of a table (per shard) and wraps any ClickHouseException thrown by that query in GET_PART_ERROR. It means the metadata query against system.parts failed, so the reader cannot determine which parts to scan.","triggerScenarios":"Calling getPartList(database, table, ...) when the system.parts query fails: table doesn't exist, system.parts is filtered to zero-access for the user, or the server is unreachable during split enumeration.","commonSituations":"Reading from a replicated/distributed table where the configured database/table resolves differently per shard; the ClickHouse user lacks grants on system.parts; transient network failure to ClickHouse during job startup.","solutions":["Confirm the table exists and the user can run `SELECT database, table, name FROM system.parts WHERE database='..' AND table='..'` in clickhouse-client.","Check ClickHouse server availability and network connectivity from the SeaTunnel worker nodes.","Grant the connector user access to system.parts (it is normally world-readable; a custom users.xml restriction may block it).","Retry the job — transient ClickHouseException (timeouts) is surfaced here; add connection/read timeout tuning if it recurs."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// ensure the metadata query works before split enumeration\nSELECT count(*) FROM system.parts WHERE database = 'db' AND table = 'tbl' AND active;","typeGuard":null,"tryCatchPattern":"try {\n    proxy.getPartList(database, table, shard, ...);\n} catch (ClickhouseConnectorException e) {\n    LOG.warn(\"system.parts query failed, retrying\", e);\n    // bounded retry with backoff, then fail\n}","preventionTips":["Verify the ClickHouse user can query system.parts for the target table.","Keep ClickHouse connections healthy (timeouts, health checks) so enumeration doesn't hit dead nodes.","Confirm database/table names resolve identically on all shards of a Distributed table."],"tags":["clickhouse","system-parts","split-enumeration","query-failed"],"backgroundTag":"database-query-failed","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}