Hi, Many people integrating Calcite with C++ or other languages opt to do so by serializing/deserializing plans to JSON (see discussion [1] for example).
Before reimplementing part of Calcite in another language it may make sense to look if you can achieve the desired result in a different way. Best, Stamatis [1] https://lists.apache.org/thread/yd5lqls6pxfn7q1m0r2onbj3x4wvohln On Wed, Dec 8, 2021 at 7:37 PM 许伟栋 <[email protected]> wrote: > Hi, All: > > I'm new to calcite, have some doubts about the SqlNode design: > > I'm working on a mysql middleware which needs parsing and query > optimization. > Unfortunately, I'm using C++, so it's not trivial to use Calcite directly. > > Instead, I'm trying to mimic what Calcite does to see if I can come up with > an MVP. > > Right now, I got the CST from Antlr4, and I'm about to visit the CST to > generate AST. > When I look at SqlNode in Calcite, I found that a common segment like table > from select statement is also the type of SqlNode. > In other implementations, it's normally the concrete type like > `TableSegment`. > I was wondering what's the purpose behind the structure design? > > Thanks in advance. >
