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