calcite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Enrico Olivelli <eolive...@gmail.com>
Subject Aliases for schemas
Date Tue, 14 Nov 2017 12:59:28 GMT
Hi,
(I am playing with the planner, you know)
I have several "schema" in my system, like "one", "two"
So my root schema is built this way:
final SchemaPlus rootSchema = Frameworks.createRootSchema(true);
        for (String tableSpace : listTableSpaces()) {
            SchemaPlus schema = rootSchema.add(tableSpace, new
AbstractSchema());
}

Queries like
SELECT * from one.mytable
SELECT * from two.mytable

get parsed and validated.

But I would like to set a "default" schema to be used when the query does
not explicitly refer to a schema, like
default-schema='one'
SELECT * from mytable

which I would expect to be parsed as
SELECT * from one.mytable

Is it possible ?


Bonus question, separate from the former, it seems that the parser
complaints if I try to use a schema with name "default", using MYSQL5_5
compatinility for instance. Is there any tweak to make it work ?

Calcite is really great!
Enrico

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