You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Dawid Wysakowicz (JIRA)" <ji...@apache.org> on 2019/05/24 09:35:00 UTC

[jira] [Resolved] (FLINK-11476) Create CatalogManager to manage multiple catalogs and encapsulate Calcite schema

     [ https://issues.apache.org/jira/browse/FLINK-11476?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dawid Wysakowicz resolved FLINK-11476.
--------------------------------------
       Resolution: Fixed
    Fix Version/s: 1.9.0

Implemented in 8516751108d829739320cb7d62c52f017d81d1a2

> Create CatalogManager to manage multiple catalogs and encapsulate Calcite schema
> --------------------------------------------------------------------------------
>
>                 Key: FLINK-11476
>                 URL: https://issues.apache.org/jira/browse/FLINK-11476
>             Project: Flink
>          Issue Type: Sub-task
>          Components: Table SQL / API
>            Reporter: Xuefu Zhang
>            Assignee: Dawid Wysakowicz
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.9.0
>
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> Flink allows for more than one registered catalogs. {{CatalogManager}} class is the holding class to manage and encapsulate the catalogs and their interrelations with Calcite.
> Following section describes how table resolution should work:
> h4. PATH resolution:
> First look into DEFAULT PATH: cat or cat.db. Then in the root. This is also the behavior of Calcite. We should mimic this behavior in Flink.
> Example:
> {noformat}
> root:
>   |- builtin
>       |- default
>           |- tab1
>           |- tab2
>       |- db1
>           |- tab1
>       |- clashing
>           |- tab1
>   |- cat1
>       |- db1
>           |- tab1
>           |- tab2
>   |- extCat1
>       |- tab1
>       |- clashing
>           |- tab1
>       |- extCat2
>           |- tab1
>           |- tab2
>   |- clashing (ExternalCatalog)
>       |- tab1
> {noformat}
>       
> There is always a default catalog, initially set to builtin and default database initially set to default.
> {noformat}
> Assume 
> default path = builtin then
>   default.tab1 = builtin.default.tab1
>   tab1 = error
>   cat1.db1.tab1 = cat1.db1.tab1
>   clashing.tab1 = builtin.clashing.tab1
> default path = extCat1 then
>   tab1 = extCat1.tab1
>   clashing.tab1 = extCat1.clashing.tab1
> default path = extCat1.extCat2 (do not support further nesting) then
>   tab1 = extCat1.extCat2.tab1
>   clashing.tab1 = clashing.tab1
> {noformat}
>   
> h4. Structure in the Planner(Calcite-specific)
> {noformat}
> root: CatalogManagerSchema(CatalogManager)
>      |- CatalogCalciteSchema(ReadableCatalog)
>          |- DatabaseCalciteSchema (ReadableCatalog scoped to DB)
>              |- Table
>      |- ExternalCatalogSchema
>          |- Table
>          |- ExternalCatalogSchema
>              |- Table
> {noformat}
> h4. Structure in the API
> {noformat}    
> CatalogManager:
>     |- ReadableCatalog
>       |- CatalogTable
>     |- ExternalCatalog
>       |- ExternalCatalog
>       |- ExternalCatalogTable
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)