Setting the "defaultSchema" of a live CalciteConnection?

2022-03-15 Thread Gavin Ray
I have a scenario in which I have a rootSchema that holds multiple datasource schemas There's a tool I'd like to integrate it with, but it can't handle (catalog -> schema -> schema) structure I figured an easy way around this would be to iterate the names of the datasource schemas, and then and t

Re: Setting the "defaultSchema" of a live CalciteConnection?

2022-03-15 Thread Julian Hyde
An ancestor project of Calcite, Eigenbase (aka Farrago) used to have a SET SCHEMA command. It would be nice if we added that back. (Maybe only in the “server” module, since in “core” the connections are stateless.) I’m a bit surprised that "CalciteConnection.setSchema(String)" doesn’t work. Put

Re: Setting the "defaultSchema" of a live CalciteConnection?

2022-03-16 Thread Gavin Ray
Julian, tried what you said. It turns out that the schema WAS being set in the Avatica driver, but it didn't seem to make any difference for the tool (For what it's worth, it's SchemaCrawler -- https://github.com/schemacrawler/SchemaCrawler) After trawling the Calcite source for hours and trying m

Re: Setting the "defaultSchema" of a live CalciteConnection?

2022-03-18 Thread Gramana, Zachary (GE Digital)
We implemented support for `SET SCHEMA` by subclassing `ServerDdlExecutor`, and calling (in our case) `AvaticaConnection.setSchema(schema)` does indeed work. However, we've also encountered some JDBC-based applications that will set the explicitly set an incorrect default schema via the connecti