Hey Calcite Developers,

I've got a handful of data streams in RxJava Observables over which we're
attempting to provide SQL querying capabilities. I'm planning to implement a
limited subset of functionality to begin with, and Rx Observables support
many
SQL or SQL like operations. My original thought was to parse the SQL using
something like ANTRL4 / Calcite and then walk the returned AST / result
modifying an rx.Observable as I go, however I see that Calcite has the
concept
of an adapter to hook the SQL into various back ends.

The objective is as follows:

- Begin with an Observable data stream.
- Apply a series of transformations / filters / etc... specified by SQL
- Return the result to the end user as another Rx Observable which
  can then be used seamlessly within this environment.

In your opinion would it be more proper to:

1. Implement an RxObservable adapter to enable streaming SQL support on Rx
   Observables.

2. Parse the SQL string using the Calcite parser and then manually walk the
   SqlNode result to manipulate an rx.Observable representing the data
stream?


Option 1 sounds a lot like LINQ SQL from the C#/.NET stack, and I'm
surprised
I haven't found an SQL over Rx Observables implementation online though I
may
have overlooked something. I'm unaware of how much work this would take
though
looking over the streaming CSV stuff I found [0][1][2] it seems as though
I'd
be extending a handful of classes from the org.apache.calcite.streaming
namespace. Would it be wrong to assume that we get a lot of functionality
for
free by implementing an adapter?

Option 2 appears more straightforward to me at this point in time, though
that is likely only due to both; the fact that I can easily envision how
to implement this, and I had intended to use the Rx operators to perform
the actual work.

In either case I'm seeking advice about which road you think I should travel
and any prior work, documents, etc... to which I can refer to get started.

Thanks!

[0]
http://mail-archives.apache.org/mod_mbox/calcite-dev/201605.mbox/%[email protected]%3E
[1]
https://git1-us-west.apache.org/repos/asf?p=calcite.git;a=commit;h=65c1cec22d93a83b73bbdb8c73d08d8642db46e1
[2]
https://github.com/apache/calcite/tree/master/example/csv/src/main/java/org/apache/calcite/adapter/csv

Reply via email to