calcite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Guohui Xiao <x...@inf.unibz.it>
Subject constructing SQL with CTE using RelBuilder
Date Wed, 14 Mar 2018 13:36:12 GMT
Hi,

We are experimenting calcite in order to generate SQL out of RA algebra. So
far it works quite well.

Now we want to construct  some relatively complex SQL queries with CTEs
using RelBuilder but we failed.

We noticed that SQL queries with CTE can be correctly parsed by the
SQLParser; however, after converting the SqlNode instance into a RelNode,
it seems that the definition of CTEs are just expanded. We understood that
this behavior might be due the there is no "spool" operator to generate
CTE-style query plans to reuse RA expressions like the issue in [1].

Here, our need is a bit simpler. We only use Calcite to generate SQL
queries out of some algebra. I am wondering if there are some subclasses of
RelNode corresponding to "SqlWith" .
More ideally, we would like to construct such queries from RelBuilder
interface.

After some study of the code base, if we understood correctly, it seems to
us that such features are not available yet. Could you confirm this and
suggest some alternatives?

Thanks a lot!

Best,

Guohui & Elem

[1] https://issues.apache.org/jira/browse/CALCITE-481



-- 
Guohui Xiao, PhD
Assistant Professor with a fixed-term contract
KRDB - Faculty of Computer Science
Free University of Bozen-Bolzano
Piazza Domenicani, 3
I-39100 Bolzano, Italy

http://www.ghxiao.org

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