Hello all!
We're looking at Calcite and I've watched the video of BOSS 21
with Stamatis and Julian.

All the examples I've seen, including the lucene example from that video
and others like the ES adapter all end up serialising their values that go
into the generated code.

 ConstantExpression luceneQuery = Expressions.constant(((LuceneRel)
input).implement().query*.toString()*);

See the toString() here. What I am wondering and haven't been able to
figure out is how do I pass the generated lucene Query object rather than a
String form of it?

I've tried seeing if there was some common object and found the DataContext
that is available in the generated code but there's no way to add a value
into the DataContext from what I can see.
I tried Expressions.dynamic but it's not implemented, couldn't quite get
Expressions.lambda to work either, throws NPE because `body` is missing?

I want to stick to one question here since I have a few but this is
related.
Is it possible to avoid the code generation here altogether? In the basic
lucene demo, the AbstractEnumerable is extended
and Linq4j.enumerator(searchIndex()) gets returned from enumerator().

I guess what I'm trying to ask is if I can use what seems like the simpler
API (returning an enumerator) whilst providing the rules the other example
uses?

Repo here for those who don't know what I'm referring to
https://github.com/zabetak/calcite-tutorial/blob/main/solution/src/main/java/com/github/zabetak/calcite/tutorial/LuceneEnumerable.java#L71


I'm literally extending the lucene tutorial example so replies in that
context (getting the generated lucene Query object passed around) are
welcome and it's not far of what we're going to need to do later.

-- 
Regards,
Courtney - CEO, Hypi <https://hypi.io/custom-software-development/>
Tel: 020 8123 2413

Reply via email to