-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The predicate problem #7
Comments
We haven't really considered this yet. I think one solution would be to have query frameworks to automatically turn The option of using |
I guess maybe I need to go back and re-read one of the discussions, but I can't really see where this is a practical issue. Right now, |
Query.jl right now has zero special casing for
There is a proposal on the table that would solve this: JuliaLang/julia#20502.
If we had to pick one semantics, I would go with those, but I would prefer to expose both semantics to users. Note also that the current implementation of Here is the example that shows why one might want to have both: q = @from i in df begin
@where i.a == 4
@select i.a == 4
@collect
end Essentially we would like the comparison in the q = @from i in df begin
@where i.a == 4
@select i.a .== 4
@collect
end This is overall based on some pretty simple principles: whenever you apply the call-site lifting operator |
Yeah, I meant that replacing
By using I'm not strongly opposed to supporting Regarding |
Ah, ok. It would be really nice if I could get rid of that conversion, though... I kind of feel we should shoot for a general way to represent missing values that works for both the array of missing values case and Query.jl (without my own custom type like
Yeah, I'm not sure this makes sense if we go with the If all the comparions operators returned
Yes, that is the C# behavior. I don't have that in DataValues.jl right now, but maybe I should... |
I'm pretty strongly opposed to continuing to use |
Let's change |
Closing since the definitions have been changed. |
One of the general issues we discovered in discussing the whole lifting story over the last months was how to deal with predicates. I thing broadly speaking @nalimilan argued that lifted versions of predicates should return
Nullable{Bool}
, whereas I argued they should returnBool
. I think at the end of the day I'm convinced that both cases have merit, and that it depends on the context of the predicate use which semantic is better.I think this problem is pretty much solved with the approach I've taken in DataValues.jl: if one uses the call-site lifting operator
.
one always gets a return value that is wrapped in aDataValue
, i.e..==
returnsDataValue{Bool}
. This essentially covers the use-case that @nalimilan had in mind. If there is a useful way to implement a predicate onDataValue
s that returns a pureBool
, that semantics can just be implemented as another method for the predicate. For example, I did that for all the comparison operators. So==
will return aBool
. That covers the use-case that I had originally in mind.Is there a plan to handle both of these use-cases with the
Union{T,Null}
proposal?The text was updated successfully, but these errors were encountered: