calcite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Muhammad Gelbana <m.gelb...@gmail.com>
Subject Re: Rewriting queries with Calcite
Date Sat, 04 May 2019 13:56:09 GMT
What do you mean by "rewrite queries to multiple data sources" ?

Assuming you mean to run specific portions of the query plan against
specific datasources, I beleive this can be done by changing the convention
of the nodes for those protions. Each convention will map to a specific
datasource. You can do that by writing converter rules.

Assuming you mean to simply rewrite an SQL query, I beleive this can be
done by visiting the root SQL node after parsing the query and rewrite the
visitied nodes the way you wish. This actually can be done by other
libraries than calcite, so I don't think that's what you're looking for.

Assuming you mean to optimize the query plan, you'll need to write
optimization rules (mentioned in the website's docs) to do that.

As Stamatis said, a more specific question might get you a more specific
answer.

Thanks,
Gelbana


On Fri, May 3, 2019 at 3:22 PM Stamatis Zampetakis <zabetak@gmail.com>
wrote:

> Hi Ivan,
>
> It sounds like an interesting project, and I think Calcite will definitely
> help you get there.
>
> However your questions are quite broad so it is difficult to provide a
> concrete answer.
> The best place to get started is the official website [1] where there are a
> lot of examples and use-cases for Calcite.
> Other than that there have been various discussions in the dev list such as
> [2] where people have shared many useful resources.
> Have a look and don't hesitate to come back to us.
>
> Good luck with your thesis!
> Stamatis
>
> [1] https://calcite.apache.org/
> [2]
>
> https://lists.apache.org/thread.html/3b32557adfc19e79e04a2d2e5ffcfa742c21e0fcfa3bd431025020ed@%3Cdev.calcite.apache.org%3E
>
> On Thu, May 2, 2019 at 11:30 AM Ivan Grgurina <Ivan.Grgurina@fer.hr>
> wrote:
>
> > Hi, I'm working with Apache Calcite for my master thesis.
> >
> > The idea is to rewrite queries to multiple data sources, and Calcite is a
> > serious candidate to be the tool for that job.
> >
> > At the moment, I'm trying to use Calcite as a library to create rules
> that
> > will rewrite queries during planner execution. I'm basing my current
> > solution on https://github.com/tzolov/calcite-sql-rewriter code.
> >
> > My question would be if that's the best practice? What's the best way of
> > creating a library based on Calcite that will be used in the end-user
> > applications? What is the dev idea behind connecting that library to
> > end-user application, as well as connecting it to Calcite?
> >
> > I have some idea of how that should work (based on above mentioned tool),
> > but I would love to hear how do it properly from the devs.
> >
> > Thanks
> >
> >
> > *Ivan Grgurina*
> >
> > Research Assistant (ZEMRIS)
> > ------------------------------
> >
> > <https://www.linkedin.com/in/igrgurina/>
> > <https://www.fer.unizg.hr/ivan.grgurina>
> >
> >
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message