Add the inequalities to the leftjoin() and leftjoin!() functions.
I refer to the inequality that implementation on the on parameter in innerjoin() function, then implemented it on the leftjoin() and leftjoin!() function.
Now, we can use leftjoin like this: leftjoin(dsl,dsr,on = [1=>1, 2=>(:lower,nothing)]).
The methods used to find ranges and idx are the same as the methods in innerjoin, i just modified the way that uses ranges and idx to generate the result dataset in leftjoin().
I have done some testing, and this function works fine, and the run time and allocations are similar with innerjoin().
Please add tests for you functions. test/join.jl has a test set for range join, you may put your tests there.
I've added tests to test/join.jl and fixed some bugs.
This is a good PR, however, I have some concerns about the way you implemented it. General feedback:
- There are lots of code repeats
- You should use
innerjoinimplementation. You may put all core computation ofinnerjoinin a new function which can handle both inner and left joins. -
leftjoinandinnerjoinare basically the same, except thatinnerjoindrops rows with no match (these rows haveinbits= false) - There are no test for
leftjoin!- the question is do we need range join forleftjoin!? I added some comments for some parts of the code.
Thank you for your advice. It seems that my code still has some problems. In this part, I forgot to change this function. So ,the test will not pass.

I made changes to the implementation of range join in leftjoin and it passed the test in test/join.jl.
Sorry, I found some problems in my code. This code is not ready yet.