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/07 14:33:00 UTC
[jira] [Updated] (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 updated FLINK-11476:
-------------------------------------
Description:
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:
h3. 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>
h3. Structure in the Planner(Calcite-specific)
root: CatalogManagerSchema(CatalogManager)
|- CatalogCalciteSchema(ReadableCatalog)
|- DatabaseCalciteSchema (ReadableCatalog scoped to DB)
|- Table
|- ExternalCatalogSchema
|- Table
|- ExternalCatalogSchema
|- Table
h4. Structure in the API
CatalogManager:
|- ReadableCatalog
|- CatalogTable
|- ExternalCatalog
|- ExternalCatalog
|- ExternalCatalogTable
was: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.
> 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
> Time Spent: 10m
> 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:
> h3. 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>
>
> h3. Structure in the Planner(Calcite-specific)
> root: CatalogManagerSchema(CatalogManager)
> |- CatalogCalciteSchema(ReadableCatalog)
> |- DatabaseCalciteSchema (ReadableCatalog scoped to DB)
> |- Table
> |- ExternalCatalogSchema
> |- Table
> |- ExternalCatalogSchema
> |- Table
> h4. Structure in the API
> CatalogManager:
> |- ReadableCatalog
> |- CatalogTable
> |- ExternalCatalog
> |- ExternalCatalog
> |- ExternalCatalogTable
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)