You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@calcite.apache.org by asma zgolli <zg...@gmail.com> on 2018/03/09 10:03:35 UTC
storage of schema (json model) in a database
hello ,
I wish to use calcite in my project and I wish to store schema definition
(json models) in a database , manage them and use the stored schema to
connect to calcite using java driver.
example :
instead of : DriverManager.getConnection(
"jdbc:calcite:model=target/classes/model.json")
I wish to be able to do the following call :
DriverManager.getConnection(
"jdbc:calcite:model=hdfs://localhost:someport/somepath/model.json")
or :
DriverManager.getConnection("jdbc:calcite:model=somemongodb_document")
is that possible ?
thank you for your help ,
I'm new to calcite and I think it suits my needs so far
--
best regards
Asma ZGOLLI
PhD student in data engineering - computer science
Tel : (+33) 07 52 95 04 45
Re: storage of schema (json model) in a database
Posted by Shuyi Chen <su...@gmail.com>.
Created jira (https://issues.apache.org/jira/browse/CALCITE-2209) for the
issue.
On Fri, Mar 9, 2018 at 3:30 PM, Julian Hyde <jh...@apache.org> wrote:
> Switching from files to URLs seems like a good idea. (You can load files
> using the “file:” protocol or omitting the protocol.)
>
> Note we have a special built-in protocol called “inline:”. Let’s keep that
> working.
>
> > On Mar 9, 2018, at 1:54 PM, Shuyi Chen <su...@gmail.com> wrote:
> >
> > Just take a quick look. I think the URLStreamHandlerFactory might be the
> > way to go, but might not work out of the box at the moment in Calcite.
> >
> > If you look at ModelHandler.java, it it reading the file using
> java.io.File
> > which assumes the platform the default local file system.
> >
> > However, I think we can change the code a bit to use the URL,
> > URLStreamHandler, and URLConnection classes to load the json file, what
> do
> > you think, Julian?
> >
> > On Fri, Mar 9, 2018 at 11:00 AM, Julian Hyde <jhyde@apache.org <mailto:
> jhyde@apache.org>> wrote:
> >
> >> Maybe you could call https://docs.oracle.com/
> javase/8/docs/api/java/net/ <https://docs.oracle.com/
> javase/8/docs/api/java/net/>
> >> URL.html#setURLStreamHandlerFactory-java.net.URLStreamHandlerFactory- <
> >> https://docs.oracle.com/javase/8/docs/api/java/net/URL.html# <
> https://docs.oracle.com/javase/8/docs/api/java/net/URL.html#>
> >> setURLStreamHandlerFactory-java.net.URLStreamHandlerFactory-> with your
> >> own custom handler. I haven’t tried it.
> >>
> >>> On Mar 9, 2018, at 2:03 AM, asma zgolli <zg...@gmail.com> wrote:
> >>>
> >>> hello ,
> >>>
> >>>
> >>> I wish to use calcite in my project and I wish to store schema
> definition
> >>> (json models) in a database , manage them and use the stored schema to
> >>> connect to calcite using java driver.
> >>>
> >>> example :
> >>>
> >>> instead of : DriverManager.getConnection(
> >>> "jdbc:calcite:model=target/classes/model.json")
> >>>
> >>> I wish to be able to do the following call :
> >>>
> >>> DriverManager.getConnection(
> >>> "jdbc:calcite:model=hdfs://localhost:someport/somepath/model.json")
> >>>
> >>> or :
> >>> DriverManager.getConnection("jdbc:calcite:model=somemongodb_document")
> >>>
> >>> is that possible ?
> >>>
> >>> thank you for your help ,
> >>>
> >>> I'm new to calcite and I think it suits my needs so far
> >>> --
> >>> best regards
> >>> Asma ZGOLLI
> >>>
> >>> PhD student in data engineering - computer science
> >>> Tel : (+33) 07 52 95 04 45
> >>
> >>
> >
> >
> > --
> > "So you have to trust that the dots will somehow connect in your future."
>
>
--
"So you have to trust that the dots will somehow connect in your future."
Re: storage of schema (json model) in a database
Posted by Julian Hyde <jh...@apache.org>.
Switching from files to URLs seems like a good idea. (You can load files using the “file:” protocol or omitting the protocol.)
Note we have a special built-in protocol called “inline:”. Let’s keep that working.
> On Mar 9, 2018, at 1:54 PM, Shuyi Chen <su...@gmail.com> wrote:
>
> Just take a quick look. I think the URLStreamHandlerFactory might be the
> way to go, but might not work out of the box at the moment in Calcite.
>
> If you look at ModelHandler.java, it it reading the file using java.io.File
> which assumes the platform the default local file system.
>
> However, I think we can change the code a bit to use the URL,
> URLStreamHandler, and URLConnection classes to load the json file, what do
> you think, Julian?
>
> On Fri, Mar 9, 2018 at 11:00 AM, Julian Hyde <jhyde@apache.org <ma...@apache.org>> wrote:
>
>> Maybe you could call https://docs.oracle.com/javase/8/docs/api/java/net/ <https://docs.oracle.com/javase/8/docs/api/java/net/>
>> URL.html#setURLStreamHandlerFactory-java.net.URLStreamHandlerFactory- <
>> https://docs.oracle.com/javase/8/docs/api/java/net/URL.html# <https://docs.oracle.com/javase/8/docs/api/java/net/URL.html#>
>> setURLStreamHandlerFactory-java.net.URLStreamHandlerFactory-> with your
>> own custom handler. I haven’t tried it.
>>
>>> On Mar 9, 2018, at 2:03 AM, asma zgolli <zg...@gmail.com> wrote:
>>>
>>> hello ,
>>>
>>>
>>> I wish to use calcite in my project and I wish to store schema definition
>>> (json models) in a database , manage them and use the stored schema to
>>> connect to calcite using java driver.
>>>
>>> example :
>>>
>>> instead of : DriverManager.getConnection(
>>> "jdbc:calcite:model=target/classes/model.json")
>>>
>>> I wish to be able to do the following call :
>>>
>>> DriverManager.getConnection(
>>> "jdbc:calcite:model=hdfs://localhost:someport/somepath/model.json")
>>>
>>> or :
>>> DriverManager.getConnection("jdbc:calcite:model=somemongodb_document")
>>>
>>> is that possible ?
>>>
>>> thank you for your help ,
>>>
>>> I'm new to calcite and I think it suits my needs so far
>>> --
>>> best regards
>>> Asma ZGOLLI
>>>
>>> PhD student in data engineering - computer science
>>> Tel : (+33) 07 52 95 04 45
>>
>>
>
>
> --
> "So you have to trust that the dots will somehow connect in your future."
Re: storage of schema (json model) in a database
Posted by Shuyi Chen <su...@gmail.com>.
Just take a quick look. I think the URLStreamHandlerFactory might be the
way to go, but might not work out of the box at the moment in Calcite.
If you look at ModelHandler.java, it it reading the file using java.io.File
which assumes the platform the default local file system.
However, I think we can change the code a bit to use the URL,
URLStreamHandler, and URLConnection classes to load the json file, what do
you think, Julian?
On Fri, Mar 9, 2018 at 11:00 AM, Julian Hyde <jh...@apache.org> wrote:
> Maybe you could call https://docs.oracle.com/javase/8/docs/api/java/net/
> URL.html#setURLStreamHandlerFactory-java.net.URLStreamHandlerFactory- <
> https://docs.oracle.com/javase/8/docs/api/java/net/URL.html#
> setURLStreamHandlerFactory-java.net.URLStreamHandlerFactory-> with your
> own custom handler. I haven’t tried it.
>
> > On Mar 9, 2018, at 2:03 AM, asma zgolli <zg...@gmail.com> wrote:
> >
> > hello ,
> >
> >
> > I wish to use calcite in my project and I wish to store schema definition
> > (json models) in a database , manage them and use the stored schema to
> > connect to calcite using java driver.
> >
> > example :
> >
> > instead of : DriverManager.getConnection(
> > "jdbc:calcite:model=target/classes/model.json")
> >
> > I wish to be able to do the following call :
> >
> > DriverManager.getConnection(
> > "jdbc:calcite:model=hdfs://localhost:someport/somepath/model.json")
> >
> > or :
> > DriverManager.getConnection("jdbc:calcite:model=somemongodb_document")
> >
> > is that possible ?
> >
> > thank you for your help ,
> >
> > I'm new to calcite and I think it suits my needs so far
> > --
> > best regards
> > Asma ZGOLLI
> >
> > PhD student in data engineering - computer science
> > Tel : (+33) 07 52 95 04 45
>
>
--
"So you have to trust that the dots will somehow connect in your future."
Re: storage of schema (json model) in a database
Posted by Julian Hyde <jh...@apache.org>.
Maybe you could call https://docs.oracle.com/javase/8/docs/api/java/net/URL.html#setURLStreamHandlerFactory-java.net.URLStreamHandlerFactory- <https://docs.oracle.com/javase/8/docs/api/java/net/URL.html#setURLStreamHandlerFactory-java.net.URLStreamHandlerFactory-> with your own custom handler. I haven’t tried it.
> On Mar 9, 2018, at 2:03 AM, asma zgolli <zg...@gmail.com> wrote:
>
> hello ,
>
>
> I wish to use calcite in my project and I wish to store schema definition
> (json models) in a database , manage them and use the stored schema to
> connect to calcite using java driver.
>
> example :
>
> instead of : DriverManager.getConnection(
> "jdbc:calcite:model=target/classes/model.json")
>
> I wish to be able to do the following call :
>
> DriverManager.getConnection(
> "jdbc:calcite:model=hdfs://localhost:someport/somepath/model.json")
>
> or :
> DriverManager.getConnection("jdbc:calcite:model=somemongodb_document")
>
> is that possible ?
>
> thank you for your help ,
>
> I'm new to calcite and I think it suits my needs so far
> --
> best regards
> Asma ZGOLLI
>
> PhD student in data engineering - computer science
> Tel : (+33) 07 52 95 04 45