[ 
https://issues.apache.org/jira/browse/CALCITE-5068?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17516202#comment-17516202
 ] 

itxiangkui commented on CALCITE-5068:
-------------------------------------

I understand the differences between catalog/schema definitions in different 
databases.
In the interactive mode of sqlline, it will be very complicated and difficult 
to manage all the information to catalog/schema/table at one time.
Maybe I need extensions to manage query context, implement use catalog/schema 
etc semantics.

I will close this feature.

> There are some problems with the use of catalog
> -----------------------------------------------
>
>                 Key: CALCITE-5068
>                 URL: https://issues.apache.org/jira/browse/CALCITE-5068
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: itxiangkui
>            Priority: Major
>
> when i use under sqlline
> !schema
> !tables
> !metadata getSchemas
> When I wait for the command, I find that the catalog seems to be a wrong meta 
> information, and it is always empty, even after I call 
> connection.setCatalog().
> Looking at the source code, found org.apache.calcite.jdbc.CalciteMetaImpl's
> bc. 
>  Enumerable<MetaSchema> schemas(final String catalog) {
>     return Linq4j.asEnumerable(
>         getConnection().rootSchema.getSubSchemaMap().values())
>         .select((Function1<CalciteSchema, MetaSchema>) calciteSchema ->
>             new CalciteMetaSchema(calciteSchema, catalog,
>                 calciteSchema.getName()))
>         .orderBy((Function1<MetaSchema, Comparable>) metaSchema ->
>             (Comparable) FlatLists.of(Util.first(metaSchema.tableCatalog, ""),
>                 metaSchema.tableSchem));
>   }
>  
> Obviously, the parameters of the catalog are not used for filtering, and 
> there is no context information of the catalog in the rootSchema. The catalog 
> is directly passed to the CalciteMetaSchema object.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to