-
Notifications
You must be signed in to change notification settings - Fork 111
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
Aggregation returns 0 rows #244
Comments
Okay, I guess this is because of bottom up evaluation - I think the workaround is to basically not do any aggregates until the very end. I was using Could the execution model somehow be extended to support infinite or generated sets evaluated lazily? Or is there a better idiom for dealing with optional rules? Could some sort of custom macro function/macro rule thing help get rid of some of the boilerplate maybe? |
Actually
produces 0 rows too. I assume here I found a workaround, but it's very labor intensive:
i.e. use Again, I don't think it can be "wrapped up" - in my full example
doesn't work because the first |
This works
Basically I hardcode all predicates and the null id to produce dummy rows in the absence of data in the I'm not sure, but maybe this ticket should be retitled like "Add tools for dealing with empty sets" or something. Either a way to create an "infinite set" where rows are only generated during conjunction or a way to provide a default for atoms that don't match (like |
Working off a random documentation example:
returns one row as expected:
But after moving this into a rule:
it returns 0 rows. AFAICT these should be semantically equivalent, so I'd expect one row with
count(year)
0 as above.In the example I used count since the definition is simple, but in my use case I need
min_cost
and I want a null value if there are no rows in the aggregation... my actual query is:(there may be other issues with it, but IIRC it worked if there's at least one value for all of the fields: name/artist/cover/etc)
The text was updated successfully, but these errors were encountered: