jdbc

jdbc(datasource, schema, table) - returns table that is connected via JDBC driver.

This table function requires separate clickhouse-jdbc-bridge program to be running.
It supports Nullable types (based on DDL of remote table that is queried).

Examples

  1. SELECT * FROM jdbc('jdbc:mysql://localhost:3306/?user=root&password=root', 'schema', 'table')
  1. SELECT * FROM jdbc('mysql://localhost:3306/?user=root&password=root', 'select * from schema.table')
  1. SELECT * FROM jdbc('mysql-dev?p1=233', 'num Int32', 'select toInt32OrZero('''') as num')
  1. SELECT *
  2. FROM jdbc('mysql-dev?p1=233', 'num Int32', 'select toInt32OrZero('''') as num')
  1. SELECT a.datasource AS server1, b.datasource AS server2, b.name AS db
  2. FROM jdbc('mysql-dev?datasource_column', 'show databases') a
  3. INNER JOIN jdbc('self?datasource_column', 'show databases') b ON a.Database = b.name