Description
The BigQuery table engine, added to ClickHouse server (present in system.table_engines on 26.8), is missing from ENGINE_TO_TABLE_TYPE in jdbc-v2/src/main/java/com/clickhouse/jdbc/metadata/DatabaseMetaDataImpl.java (map built at lines 776-893).
Two consequences:
- The repo's own completeness test
DatabaseMetaDataTest#testAllTableEnginesFromSystemTableEnginesAreMapped fails against a 26.8 server.
DatabaseMetaData#getTables reports TABLE_TYPE = TABLE for a BigQuery-engine table (the getOrDefault fallback at line 908), and such a table is not returned when the caller asks for types = {"REMOTE TABLE"}. Every other external integration engine (URL, MySQL, S3, Iceberg, MongoDB, ...) is mapped to REMOTE TABLE.
Steps to reproduce
- Start a ClickHouse server that has the
BigQuery engine (verified on 26.8.1.1307; not present on 26.7).
- Run
DatabaseMetaDataTest#testAllTableEnginesFromSystemTableEnginesAreMapped — it fails.
- Create a
BigQuery-engine table and read its TABLE_TYPE through DatabaseMetaData#getTables — it is TABLE.
Error Log or Exception StackTrace
DatabaseMetaDataTest.testAllTableEnginesFromSystemTableEnginesAreMapped:702
All table engines from system.table_engines must be mapped in
DatabaseMetaDataImpl.ENGINE_TO_TABLE_TYPE or handled by System/Async prefix.
Unmapped engines: [BigQuery] expected [true] but found [false]
Expected Behaviour
The server reports the engine, so the driver must map it:
$ curl "http://<server>:8123/?query=SELECT name FROM system.table_engines WHERE name = 'BigQuery' FORMAT TSV"
BigQuery
$ curl "http://<server>:8123/?query=SELECT engine FROM system.tables WHERE name = 'bq_probe' FORMAT TSV"
BigQuery
getTables must report TABLE_TYPE = REMOTE TABLE for a BigQuery table, the same as for the other external integration engines, and the table must be returned when types = {"REMOTE TABLE"} is requested.
Observed instead (probe run against 26.8.1.1307, current main @ 601ade1):
server engine = BigQuery
getTables(types = null) TABLE_TYPE = TABLE <-- expected REMOTE TABLE
getTables(types = ["REMOTE TABLE"]) = 0 rows <-- expected 1 row
getTables(types = ["TABLE"]) = 1 row <-- unexpected
contrast, URL engine TABLE_TYPE = REMOTE TABLE
Code Example
try (Connection conn = getJdbcConnection(); Statement stmt = conn.createStatement()) {
stmt.executeUpdate("CREATE TABLE bq_probe (a Int32) ENGINE = BigQuery('proj','ds','tbl','key')");
DatabaseMetaData dbmd = conn.getMetaData();
try (ResultSet rs = dbmd.getTables(null, conn.getSchema(), "bq_probe", null)) {
while (rs.next()) {
System.out.println(rs.getString("TABLE_TYPE")); // prints TABLE, expected REMOTE TABLE
}
}
}
Root cause
DatabaseMetaDataImpl.ENGINE_TO_TABLE_TYPE (static initializer, DatabaseMetaDataImpl.java:777-893) has no BigQuery entry. engineToTableType (line 908) therefore returns the TableType.TABLE default. getEnginesForTableTypes (line 915) also omits it, so the REMOTE TABLE filter in getTables (line 966) never selects it, while the "engines not in our map default to TABLE" filter (line 971) does.
Suggested fix
Add to the "Remote/External tables" block:
map.put("BigQuery", TableType.REMOTE_TABLE.getTypeName());
This is the same maintenance step taken in #2861 and #2950 when the server added new engines. No other engine name in system.table_engines on 26.8.1.1307 is unmapped, so BigQuery is the only addition needed.
Configuration
Environment
ClickHouse Server
- ClickHouse Server version: 26.8.1.1307 (
clickhouse/clickhouse-server:head). Not reproducible on 26.7 — the engine does not exist there.
- ClickHouse Server non-default settings, if any: none relevant
CREATE TABLE statements for tables involved:
CREATE TABLE bq_probe (a Int32) ENGINE = BigQuery('proj','ds','tbl','key');
(The table is created successfully with placeholder arguments; no GCP credentials are needed to reproduce, because only the metadata path is exercised.)
Found by automated analysis of the client while working on an unrelated change, and verified against a live server rather than by inspection.
Description
The
BigQuerytable engine, added to ClickHouse server (present insystem.table_engineson 26.8), is missing fromENGINE_TO_TABLE_TYPEinjdbc-v2/src/main/java/com/clickhouse/jdbc/metadata/DatabaseMetaDataImpl.java(map built at lines 776-893).Two consequences:
DatabaseMetaDataTest#testAllTableEnginesFromSystemTableEnginesAreMappedfails against a 26.8 server.DatabaseMetaData#getTablesreportsTABLE_TYPE = TABLEfor aBigQuery-engine table (thegetOrDefaultfallback at line 908), and such a table is not returned when the caller asks fortypes = {"REMOTE TABLE"}. Every other external integration engine (URL,MySQL,S3,Iceberg,MongoDB, ...) is mapped toREMOTE TABLE.Steps to reproduce
BigQueryengine (verified on 26.8.1.1307; not present on 26.7).DatabaseMetaDataTest#testAllTableEnginesFromSystemTableEnginesAreMapped— it fails.BigQuery-engine table and read itsTABLE_TYPEthroughDatabaseMetaData#getTables— it isTABLE.Error Log or Exception StackTrace
Expected Behaviour
The server reports the engine, so the driver must map it:
getTablesmust reportTABLE_TYPE = REMOTE TABLEfor aBigQuerytable, the same as for the other external integration engines, and the table must be returned whentypes = {"REMOTE TABLE"}is requested.Observed instead (probe run against 26.8.1.1307, current
main@ 601ade1):Code Example
Root cause
DatabaseMetaDataImpl.ENGINE_TO_TABLE_TYPE(static initializer,DatabaseMetaDataImpl.java:777-893) has noBigQueryentry.engineToTableType(line 908) therefore returns theTableType.TABLEdefault.getEnginesForTableTypes(line 915) also omits it, so theREMOTE TABLEfilter ingetTables(line 966) never selects it, while the "engines not in our map default to TABLE" filter (line 971) does.Suggested fix
Add to the "Remote/External tables" block:
This is the same maintenance step taken in #2861 and #2950 when the server added new engines. No other engine name in
system.table_engineson 26.8.1.1307 is unmapped, soBigQueryis the only addition needed.Configuration
Environment
main@ 601ade1 (0.10.0-rc1-SNAPSHOT)ClickHouse Server
clickhouse/clickhouse-server:head). Not reproducible on 26.7 — the engine does not exist there.CREATE TABLEstatements for tables involved:(The table is created successfully with placeholder arguments; no GCP credentials are needed to reproduce, because only the metadata path is exercised.)
Found by automated analysis of the client while working on an unrelated change, and verified against a live server rather than by inspection.