You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Ivan Grgurina (JIRA)" <ji...@apache.org> on 2019/05/26 06:03:00 UTC

[jira] [Comment Edited] (CALCITE-3091) Expose defaultSchema .json parameter to SchemaFactory

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

Ivan Grgurina edited comment on CALCITE-3091 at 5/26/19 6:02 AM:
-----------------------------------------------------------------

Hi [~zabetak],

I actually need a way to mark multiple shemas as default, for which the simplest solution would be to make the defaultSchema property take a list as well as a string by default, but that is a little bit far-fetched since I don't know how many other people need that and at the moment seems fairly specific to my use-case. If more people think this might be useful, we can go that way.

 

It is also indeed possible to use the operand property for that, but I'm trying to DRY and operand property forces you to sometimes put things on the schema level, when they should have been at the root level.

One solution for that is to *make a similar rootOperand property on the root level of the .json configuration that's visible in the SchemaFactory implementation*. Maybe that is the best one.


was (Author: igrgurina):
Hi [~zabetak],

I actually need a way to mark multiple shemas as default, for which the simplest solution would be to make the defaultSchema property take a list as well as a string by default, but that is a little bit far-fetched since I don't know how many other people need that and at the moment seems fairly specific to my use-case. If more people thing this might be useful, we can go that way.

 

It is also indeed possible to use the operand property for that, but I'm trying to DRY and operand property forces you to sometimes put things on the schema level, when they should have been at the root level.

One solution for that is to *make a similar rootOperand property on the root level of the .json configuration that's visible in the SchemaFactory implementation*. Maybe that is the best one.

> Expose defaultSchema .json parameter to SchemaFactory
> -----------------------------------------------------
>
>                 Key: CALCITE-3091
>                 URL: https://issues.apache.org/jira/browse/CALCITE-3091
>             Project: Calcite
>          Issue Type: Improvement
>          Components: jdbc-adapter
>    Affects Versions: 1.19.0
>            Reporter: Ivan Grgurina
>            Priority: Major
>
> Currently, when you use JDBC adapter and have custom schema factory, you provide .json file with your schema definition and link to your SchemaFactory implementation that is called to create that Schema for the rest of the system. 
> That .json file has in root a 'defaultSchema' parameter that Calcite uses to know what the default schema is. Unfortunately, that parameter is not exposed when implementing SchemaFactory interface, and there are use cases where that would be useful.
> For example, one use case is when having multiple custom schemas, to know which one is the default one while you're creating it inside SchemaFactory implementation.
> My specific use-case is I want to use that .json parameter for "filtering" schemas. The current workaround for that is to have two SchemaFactory implementations that are then later connected in code, but it would be easier if I could just check in SchemaFactory if my schema is the defaultSchema and do the appropriate logic there.
> I'm willing to do the work to make this change if someone can point me in the right direction.



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