calcite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Valeriy Trofimov <valtroffut...@gmail.com>
Subject inter-database queries
Date Thu, 09 May 2019 23:39:00 GMT
Hi All,

How can I do inter-database join via Calcite? According to answer to
similar question it's possible:
https://stackoverflow.com/questions/31975457/apache-calcite-data-federation-usecase

I've tried doing it but the issue seems to be that I can only use one
schema for my queries, even though the model file allows having several
schemas.

For example, using this model file:

{
  version: '1.0',
  defaultSchema: 'schema1',
  schemas: [
    {
      name: 'schema1',
      type: 'custom',
      factory: 'org.apache.calcite.adapter.jdbc.JdbcSchema$Factory',
      operand: {
        jdbcDriver: 'com.mysql.jdbc.Driver',
        jdbcUrl: 'jdbc:mysql://localhost/db1',
        jdbcUser: 'root',
        jdbcPassword: 'pass'
      }
    },
    {
      name: 'schema2',
      type: 'custom',
      factory: 'org.apache.calcite.adapter.jdbc.JdbcSchema$Factory',
      operand: {
        jdbcDriver: 'com.mysql.jdbc.Driver',
        jdbcUrl: 'jdbc:mysql://localhost/db2',
        jdbcUser: 'root',
        jdbcPassword: 'pass'
      }
    }
  ]
}

You can query only db1, because defaultSchema is set to be schema1.

Thanks,
Val

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message