In calcite 1.9.0, it seems I cannot list tables that are stored in the
"root schema". In sqline, when I do "!tables" I see the content of my sub
schemas but none of the tables that were added directly under the root
schema. I suspect that the code responsible for this behaviour is this
(org.apache.calcite.jdbc.CalciteMetaImpl#schemas):
Enumerable<MetaSchema> schemas(String catalog) {
return Linq4j.asEnumerable(
getConnection().rootSchema.getSubSchemaMap().values())
.select(
new Function1<CalciteSchema, MetaSchema>() {
public MetaSchema apply(CalciteSchema calciteSchema) {
return new CalciteMetaSchema(
calciteSchema,
connection.getCatalog(),
calciteSchema.getName());
}
})
.orderBy(
new Function1<MetaSchema, Comparable>() {
public Comparable apply(MetaSchema metaSchema) {
return (Comparable) FlatLists.of(
Util.first(metaSchema.tableCatalog, ""),
metaSchema.tableSchem);
}
});
}
It takes the rootSchema and analyzes only the sub schemas. The root schema
itself doesn't seem to be included in the schema list. Is this
intentional? Is the root schema more of a placeholder not meant to store
tables?
----------------------------------------------------
Mark Christiaens
Senior R&D Engineer
NGData
Sint-Salvatorstraat 18/303 9000 Gent
Belgium