crate / sqlalchemy-cratedb

SQLAlchemy dialect for CrateDB.
https://cratedb.com/docs/sqlalchemy-cratedb/
Apache License 2.0
3 stars 2 forks source link

SQLAlchemy: Investigate sub-query variants of queries with count and aggregate functions #91

Open amotl opened 1 year ago

amotl commented 1 year ago

Hi there,

at https://github.com/crate/crate-python/pull/464#discussion_r1054178351, we found a spot in the documentation which reads like that:

SQLAlchemy supports different approaches to issue a query with a count aggregate function. Take a look at the count result rows documentation for a full overview.

CrateDB currently does not support all variants as it can not handle the sub-queries yet. This means that queries using count() have to be written in one of the following ways: [...]

It may be a thing of the past. Based on this observation, we should re-evaluate the matter and create a corresponding issue at the crate/crate repository if there are still variants CrateDB can't handle.

With kind regards, Andreas.

References

https://github.com/crate/crate-python/blob/5dc0e04362b3c20f583b0ca9d034bfff78eda087/docs/by-example/sqlalchemy/advanced-querying.rst?plain=1#L108-L119

https://github.com/crate/crate-python/blob/5dc0e04362b3c20f583b0ca9d034bfff78eda087/docs/sqlalchemy.rst?plain=1#L489-L511

amotl commented 1 year ago

@seut said there are no known pitfalls with sub-queries with current versions of CrateDB, so we should remove that statement from the documentation.