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

[SQL] Operational Error: too many FROM clause terms, max 200 #406

Open
antonylebechec opened this issue Apr 25, 2022 · 4 comments
Open

[SQL] Operational Error: too many FROM clause terms, max 200 #406

antonylebechec opened this issue Apr 25, 2022 · 4 comments
Assignees
Labels
bug Something isn't working core Cutevariant core high-priority

Comments

@antonylebechec
Copy link
Collaborator

Describe the bug
SQL Error where too many samples are selected

To Reproduce
Steps to reproduce the behavior, for example:

  1. Select multiple samples in Validation plugin (or a big database?)
  2. Apply a filter
  3. See error:
"Operational Error: too many FROM clause terms, max 200"

Expected behavior
SQL query ok, no bug.
Probably LEFT/INNER JOIN problem.
Find a way to deal with multiple samples at the time.
See if using Sources solve the problem.

@antonylebechec antonylebechec added bug Something isn't working core Cutevariant core high-priority labels Apr 25, 2022
@dridk
Copy link
Member

dridk commented Apr 26, 2022

I suspect this comes from SQLite.
I would like to set a maximum field selection . It is unreadable to display 200 samples on the same line.

@antonylebechec
Copy link
Collaborator Author

I agree for a maximum number of fields, on variant view.
However, we will probably use CuteVariant to explore statistically, or with deep learning, and in that way, we will probably need to select a large number of information (fields) for a large number of samples (LEFT JOIN)

@antonylebechec
Copy link
Collaborator Author

antonylebechec commented Apr 27, 2022

Maybe by using the variable SQLITE_MAX_SRCLIST
https://github.com/sqlite/sqlite/blob/master/src/build.c
But I don't know how to change this... except by recompile SQLite...

@antonylebechec
Copy link
Collaborator Author

Dealing with more than 200 samples in a VQL query (e.g. WHERE samples.$any.gt >=0) is impossible.
But a plugin specific for statistical questions using specific SQL queries is possible.
An idea should be to reduce the number of considered samples to those on the "basket" (cf Validation plugin)

SamuelNicaise added a commit that referenced this issue Nov 15, 2023
- Add 'selected_samples' state to prevent Genotype based queries from failing due to too many SQLite clause terms
- Pass it to querybuilder
- Log message instead of letting the unrecoverable error occur
- Fix group by widget related issues
- Fix report related issues
- Update tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working core Cutevariant core high-priority
Projects
None yet
Development

No branches or pull requests

3 participants