-
Notifications
You must be signed in to change notification settings - Fork 4
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
Error with facet suggestions #21
Comments
Hey, glad you were able to get it working. I think you're touching on two things.
Re (1) - The Datasette object exposes a way to query the setting values. Maybe Re (2) - the rationale for this suggestion was performance, not correctness. When running SQLite queries, Datasette can interrupt them if they take longer than, say, a second. So with SQLite, facet suggestions can be slow, but not prevent the system from working. With DuckDB, queries aren't interruptible, so facet suggestions can make the system appear to hang. But in this case, it looks like DuckDB thinks the query is invalid, and that's throwing an exception. This might be due to SQLite's loosey-goosey rules on GROUP BY. That is, SQLite permits the query, but DuckDB rejects it. There is a very real chance that, although that query "works" in SQLite, it does not do what the author intended. Do you have a full stack trace? If we could figure out which facet is generating that SQL, we might want to open a bug against it. |
Thanks for the quick feedback! Here is the full stacktrace:
GitHub doesn't allow me to upload a parquet file but I used a small test file like this: {
"plugins": {
"datasette-parquet": {
"testdb": {
"directory": "./testdata"
}
}
}
} Error happens with
No error with
|
Seems to have to do with the The query seems to be (from commenting out the SELECT provenance AS value, COUNT(*) AS n FROM (SELECT value, provenance, code, category, year FROM test) WHERE NOT value IS NULL GROUP BY value LIMIT 31 |
Here is the query in Datasette: When I run the test data in a Sqlite db with Datasette this works, so this seems to be something working differently with DuckDB. |
It's a problem with Datasette's query (when there is a 'value' column), I've created an issue there: simonw/datasette#2208 |
Ah, great, thanks for chasing that down! I'll leave this open as a reminder that it'd be good to add a warning about facet suggestions on startup |
Absolutely fantastic project, thanks a lot!
As hinted to in the Readme, disabling facet suggestions might be needed.
Without it disabling I was getting an error when clicking on a view of a parquet file:
When started with
there is no problem.
Not sure if there is a way to check or prevent this error without it, happy to look into it if you have any pointers!
("unit" is a column of string values.)
The text was updated successfully, but these errors were encountered: