0

I didn't find any first hand info on this, would Calcite be able to work on general Scala case classes in a way similar to this one https://devth.com/2017/compiled-queries-in-scala?

schrepfler
  • 107
  • 2
  • 7
  • I'm not entirely clear what you're asking. You could certainly build up a relational algebra expression, optimize it with Calcite and then write an interpreter to execute the query corresponding to that expression on whatever data structure you want. – Michael Mior Nov 23 '17 at 17:02
  • I'll go a bit further, let's say we have a custom evaluation engine (composition and application of scala partial functions which reduce a collection based on a set of filters/constraints which can be composed arbitrarily.) Would it be possible to map these onto Calcite's API and take advantage of the planner and other mechanics of the runtime. For example, I can see a JavaTypeFactory or specific DB's but nothing which works with Scala's case classes for example. – schrepfler Nov 26 '17 at 16:10
  • You would simply construct relational algebra expressions using the Java API, run the optimizer, then interpret these expressions using your evaluation engine. You could pick any reasonable equivalent to whatever Scala types you're using in Java. The specific types shouldn't matter if you're using your own evaluation engine. – Michael Mior Nov 28 '17 at 16:46

0 Answers0