Hi,

Just a quick note to mention that I've managed to implement what I wanted
in terms of non equi-joins.
Should someone be interested, I've put my code on
https://github.com/dalbani/solr-streaming-expressions.

By the way, I happened to need a startsWith function and I implemented it
quite easily.
But I'm wondering if a very generic -- if not possibly not very safe --
java() evaluator could be built.
That would open streaming expressions to the whole Java API instead of
having to write individual evaluators.
For the example of startsWith, it could look like something in the range of:

> java(val(Hello), val(World), "arg0.startsWith(arg1)")

Using say, https://www.javassist.org/, to turn the code argument into
bytecode.
What do you think?

Regards,

On Wed, Dec 29, 2021 at 12:39 PM Damiano Albani <damiano.alb...@gmail.com>
wrote:

> Hello,
>
> I'm new to streaming expressions, so I'm trying to understand their
> features and limitations.
> In particular the so-called "stream operators" implementing join
> operations.
> Like "innerJoin", "leftOuterJoin", etc.
>
> I see that they support a "on" parameter, defining the *equality* check
> to be performed.
> But, coming from the SQL world, I'm used to being able to use a variety of
> comparison operators in join predicates. That is, not only equality, as in
> "equi-joins".
>
> Is there a reason why the current implementation of Solr supports
> equi-joins only? Would it be technically possible (and desired) to support
> other comparison operators with joins?
> And maybe somehow allow the use of the available stream evaluators
> <https://solr.apache.org/guide/8_11/stream-evaluator-reference.html>?
>
> To give the context of my question: I'm trying to join 2 sets of documents
> with a hierarchical relationship.
> My goal is to join them using a "path" field on one side and
> "descendent_path" field on the other side.
> But it looks like that only doc values are accessible (and not analyzed
> ones) in streams, so I suppose I'd be left with a join criteria like this
> pseudo-code:
>
>>   on="starts_with(right.path, left.path)"
>
> Where, in this hypothetical example:
>
>>   left.path=/categories/category1"
>>   right.path=/categories/category1/sub-categories/sub-category-a"
>
>
> Or do I completely misunderstand how Solr (streams) work? ;-)
> Thanks for your help!
>
> Regards,
>
> --
> Damiano Albani
>


-- 
Damiano Albani

Reply via email to