Skip to content
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

limit support? #28

Open
bicycle1885 opened this issue Oct 25, 2016 · 7 comments
Open

limit support? #28

bicycle1885 opened this issue Oct 25, 2016 · 7 comments

Comments

@bicycle1885
Copy link

Hi, I'm interested in using this interface to access biological annotation databases. Databases may be located in a local machine or over the Internet. In such a case, we often want to retrieve a small part of results to quickly check whether the query works as expected. If it takes a long time to retrieve all records, I guess we want something like head (or tail) verb to limit the number of maximum records.

What I have in mind is something like this:

@query humanDB |> filter(chromosome == "12") |> select(gene, locus) |> head(10)

Do you think it's worth adding to the verbs?

@nalimilan
Copy link

Could be useful. Though there have been lots of conflicts between different packages defining this function. We should either add it to Julia Base or find an appropriate home for it (maybe AbstractTables?).

@johnmyleswhite
Copy link
Collaborator

Maybe this should be something like limit? Some large-scale databases can't support an option like head or tail since the result set isn't ordered. They're only able to short-circuit accumulation of the result set.

@bicycle1885
Copy link
Author

I think there is no need to define names like head or tail in this package directly because queries are parsed in the @query macro. What we really need would be just a node that limits the number of records. limit may be a better name since it has a good correspondence to SQL's LIMIT clause.

@davidagold
Copy link
Owner

I agree something like this should be supported. There could be a limit verb. Another option, which I've played with elsewhere, is to include limit and offset as kwargs to collect.

@davidagold
Copy link
Owner

I agree something like this should be supported. There could be a limit
verb. Another option, which I've played with elsewhere, is to include limit
and offset as kwargs to collect.

On Tuesday, October 25, 2016, John Myles White [email protected]
wrote:

Maybe this should be something like limit? Some large-scale databases
can't support an option like head or tail since the result set isn't
ordered. They're only able to short-circuit accumulation of the result set.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#28 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ALUCm5KiEfLnmogl4I6H_CJpdKrt4ZgXks5q3nvkgaJpZM4KggPp
.

@bicycle1885
Copy link
Author

But we may want to limit subqueries when joining some queries. Adding the limit argument to collect can't do that, can it?

@bicycle1885 bicycle1885 changed the title head and tail support? limit support? Oct 28, 2016
@davidagold
Copy link
Owner

Sorry for my delay in addressing your comment. I cite graduate school. You make a very good point. I'm now in favor of including LimitNode and OffsetNode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants