[
https://issues.apache.org/jira/browse/CALCITE-7022?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Stamatis Zampetakis resolved CALCITE-7022.
------------------------------------------
Fix Version/s: 1.40.0
Resolution: Fixed
Fixed in
[79301845a895b58c08981c644464162251626dcb|https://github.com/apache/calcite/commit/79301845a895b58c08981c644464162251626dcb].
Thanks for the reviews [~nobigo] and [~asolimando]!
> Decouple ModelHandler from CalciteConnection
> --------------------------------------------
>
> Key: CALCITE-7022
> URL: https://issues.apache.org/jira/browse/CALCITE-7022
> Project: Calcite
> Issue Type: Task
> Reporter: Stamatis Zampetakis
> Assignee: Stamatis Zampetakis
> Priority: Major
> Labels: pull-request-available
> Fix For: 1.40.0
>
>
> [ModelHandler|https://github.com/apache/calcite/blob/f8fc4ca37e4a60236894c382ce8c8553adc3d43a/core/src/main/java/org/apache/calcite/model/ModelHandler.java]
> is mainly a parser that can transform YAML/JSON files into SchemaPlus
> objects.
> Currently, the class requires a CalciteConnection in order to be instantiated
> and the latter is a pretty heavyweight object. The usage of the
> CalciteConnection makes it rather cumbersome to instantiate and use the
> parsing capabilities of the ModelHander independently.
> In reality though, the handler does not need much from the CalciteConnection
> and we could easily refactor the handler to not depend on the connection at
> all.
> The motivation for this change is to facilitate the creation of schema
> objects from YAML/JSON files. A prominent use-case that I have in mind is the
> use of ModelHandler in unit tests where the models reside in JSON/YAML files.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)