|
| 1 | +# Source Map |
| 2 | + |
| 3 | +A structural map of the repository for fast, offline triage. Use it to pick the |
| 4 | +**module label** and **`area:*` labels** and to jump straight to the relevant |
| 5 | +source instead of grepping the whole tree. |
| 6 | + |
| 7 | +Keep this map structural (modules, packages, entry points, label → location). |
| 8 | +Do not add line numbers or exhaustive class lists — they go stale. When a |
| 9 | +mapping below is wrong because the code moved, fix the boundary here. |
| 10 | + |
| 11 | +## Modules at a glance |
| 12 | + |
| 13 | +| Module label | Directory | Root package | What it is | |
| 14 | +| --- | --- | --- | --- | |
| 15 | +| `client-api-v2` | `client-v2/` | `com.clickhouse.client.api` | Current HTTP client (the "v2" client). | |
| 16 | +| `client-v1` | `clickhouse-client/`, `clickhouse-http-client/` | `com.clickhouse.client` (no `.api`) | Legacy v1 client stack. | |
| 17 | +| `client-v1` (data) | `clickhouse-data/` | `com.clickhouse.data` | Shared data types, codecs, formats, streams. Used by v1 and indirectly elsewhere. | |
| 18 | +| `jdbc-v2` | `jdbc-v2/` | `com.clickhouse.jdbc` | Current JDBC driver (built on client-v2). | |
| 19 | +| `jdbc-v1` | `clickhouse-jdbc/` | `com.clickhouse.jdbc` | Legacy JDBC driver (built on client-v1). | |
| 20 | +| (r2dbc) | `clickhouse-r2dbc/` | `com.clickhouse.r2dbc` | R2DBC integration. No dedicated label — use `area:integration`. | |
| 21 | + |
| 22 | + |
| 23 | +## Disambiguating v1 vs v2 (important) |
| 24 | + |
| 25 | +Package prefixes overlap between versions, so use class-name cues: |
| 26 | + |
| 27 | +- **Client v2 vs v1**: v2 lives under `com.clickhouse.client.api.*` and its entry |
| 28 | + point is `Client` (`client-v2/.../api/Client.java`). v1 lives under |
| 29 | + `com.clickhouse.client.*` / `com.clickhouse.client.http.*` with no `.api` |
| 30 | + segment (e.g. `ClickHouseClient`, `ClickHouseHttpClient`). |
| 31 | +- **JDBC v2 vs v1**: both use `com.clickhouse.jdbc`. v2 uses `*Impl` classes |
| 32 | + (`ConnectionImpl`, `StatementImpl`, `PreparedStatementImpl`, `ResultSetImpl`, |
| 33 | + `DatabaseMetaDataImpl`, `Driver`, `DataSourceImpl`) under `jdbc-v2/`. |
| 34 | + v1 uses `ClickHouse*` classes (`ClickHouseConnection`, `ClickHouseStatement`, |
| 35 | + `ClickHouseDriver`, `ClickHouseDataSource`) under `clickhouse-jdbc/`. |
| 36 | +- If the issue does not say which version, note it as a question for the user, |
| 37 | + but make a best guess from the class names / JDBC URL / Maven coordinates in |
| 38 | + the report. |
| 39 | + |
| 40 | + |
| 41 | +## `area:*` label → source location |
| 42 | + |
| 43 | +Use these to attach `area:` labels and to find the implementing code. |
| 44 | + |
| 45 | +- **`area:client-insert`** — `client-v2/.../api/insert/` (`InsertResponse`, |
| 46 | + `InsertSettings`) and `Client.insert*`. v1: `clickhouse-client`/`http-client`. |
| 47 | +- **`area:client-read`** — `client-v2/.../api/query/` (`QueryResponse`, |
| 48 | + `QuerySettings`, `GenericRecord`, `Records`) and `Client.query*`. |
| 49 | +- **`area:client-pojo-serde`** — `client-v2/.../api/serde/` (`POJOSerDe`, |
| 50 | + `POJOFieldSerializer`, `POJOFieldDeserializer`) and |
| 51 | + `client-v2/.../api/metadata/` matching strategies (`ColumnToMethodMatchingStrategy`). |
| 52 | +- **`area:data-type`** — `clickhouse-data/.../data/` core (`ClickHouseDataType`, |
| 53 | + `ClickHouseColumn`, `ClickHouseValue(s)`, `value/`) and client-v2 |
| 54 | + `api/data_formats/` readers/writers. jdbc-v2 type wrappers in |
| 55 | + `jdbc-v2/.../jdbc/types/` (`Array`, `Struct`). |
| 56 | +- **`area:format`** — `clickhouse-data/.../data/format/` (RowBinary, TSV, JSON |
| 57 | + processors) and `client-v2/.../api/data_formats/` (`RowBinary*FormatReader/Writer`, |
| 58 | + `NativeFormatReader`). Compression: `clickhouse-data/.../data/compress/`. |
| 59 | +- **`area:network`** — `client-v2/.../api/transport/` (`Endpoint`, `HttpEndpoint`), |
| 60 | + `api/http/`, connection/config (`ClientConfigProperties`, |
| 61 | + `ConnectionInitiationException`, `ConnectionReuseStrategy`). v1: |
| 62 | + `clickhouse-http-client/.../client/http/`. |
| 63 | +- **`area:error-handling`** — exception types across modules: client-v2 |
| 64 | + `ClientException`, `ServerException`, `ClickHouseException`, `ClientFaultCause`, |
| 65 | + `DataTransferException`; jdbc `SqlExceptionUtils` (v1); data `ClickHouseChecker`. |
| 66 | +- **`area:jdbc-insert`** — `jdbc-v2/.../jdbc/` `PreparedStatementImpl`, |
| 67 | + `WriterStatementImpl`. v1: `clickhouse-jdbc/.../jdbc/ClickHousePreparedStatement`. |
| 68 | +- **`area:jdbc-read`** — `jdbc-v2/.../jdbc/` `ResultSetImpl`, `StatementImpl`. |
| 69 | + v1: `ClickHouseResultSet`, `ClickHouseStatement`. |
| 70 | +- **`area:jdbc-metadata`** — `jdbc-v2/.../jdbc/metadata/` (`DatabaseMetaDataImpl`, |
| 71 | + `ResultSetMetaDataImpl`, `ParameterMetaDataImpl`). v1: |
| 72 | + `ClickHouseDatabaseMetaData`, `ClickHouseResultSetMetaData`, `JdbcTypeMapping`. |
| 73 | +- **`area:sql-parser`** — new parser in `jdbc-v2/.../jdbc/internal/parser/` |
| 74 | + (incl. `javacc/`). |
| 75 | +- **`area:old-stmt-parsing`** — legacy parser in |
| 76 | + `clickhouse-jdbc/.../jdbc/parser/` (`ClickHouseSqlParser`, `ClickHouseSqlUtils`, |
| 77 | + `ClickHouseSqlStatement`). |
| 78 | +- **`area:integration`** — `clickhouse-r2dbc/`, or third-party framework glue |
| 79 | + (Spring, Hibernate, etc.) referenced in the issue. |
| 80 | +- **`area:packaging`** — `packages/clickhouse-jdbc-all/`, Maven `pom.xml` build/ |
| 81 | + shading/distribution concerns. |
| 82 | +- **`area:dependencies`** — dependency version bumps in `pom.xml` files. |
| 83 | +- **`area:docs`** — documentation gaps (no code area implied). |
| 84 | +- **`area:general`** — use only when nothing above fits. |
| 85 | + |
| 86 | + |
| 87 | +## Entry points (start reading here) |
| 88 | + |
| 89 | +- **client-v2**: `client-v2/.../api/Client.java` (builder + query/insert API), |
| 90 | + `ClientConfigProperties` (config keys). |
| 91 | +- **jdbc-v2**: `jdbc-v2/.../jdbc/Driver.java`, `ConnectionImpl`, `StatementImpl`, |
| 92 | + `DriverProperties`. |
| 93 | +- **client-v1**: `clickhouse-client/.../client/` and |
| 94 | + `clickhouse-http-client/.../client/http/`. |
| 95 | +- **jdbc-v1**: `clickhouse-jdbc/.../jdbc/ClickHouseConnection.java`, |
| 96 | + `ClickHouseDriver`. |
| 97 | +- **data**: `clickhouse-data/.../data/ClickHouseDataProcessor`, |
| 98 | + `ClickHouseColumn`, `format/`. |
| 99 | + |
| 100 | + |
| 101 | +## Stacktrace → module heuristics |
| 102 | + |
| 103 | +Map the top app-owned frames (ignore JDK/third-party frames) by package: |
| 104 | + |
| 105 | +- `com.clickhouse.client.api.*` → **client-api-v2** (then pick area by sub-package: |
| 106 | + `insert`/`query`/`serde`/`data_formats`/`transport`). |
| 107 | +- `com.clickhouse.client.*` (no `.api`) / `com.clickhouse.client.http.*` → |
| 108 | + **client-v1**. |
| 109 | +- `com.clickhouse.jdbc.*Impl` or `com.clickhouse.jdbc.internal.parser.*` → |
| 110 | + **jdbc-v2**. |
| 111 | +- `com.clickhouse.jdbc.ClickHouse*` or `com.clickhouse.jdbc.parser.*` → |
| 112 | + **jdbc-v1**. |
| 113 | +- `com.clickhouse.data.*` → **clickhouse-data** (shared); attach `area:data-type` |
| 114 | + / `area:format` / compression by sub-package. Identify the *caller* module to |
| 115 | + set the module label. |
| 116 | +- `com.clickhouse.r2dbc.*` → r2dbc (`area:integration`). |
0 commit comments