cube
cube copied to clipboard
allowUngroupedWithoutPrimaryKey on a per-cube or view basis?
Is your feature request related to a problem? Please describe.
I want to have a simple query which just returns the contents of the table without grouping etc (ie returns log-lines to the client). This is a pure logging table in Clickhouse so we don't have a proper primary key on it. If I want to allow the use of ungrouped
then I also need to allow allowUngroupedWithoutPrimaryKey
in the server options.
It would be nicer if rather than allowing this everywhere we could only allow it on certain views/cubes.
Describe the solution you'd like
A new view option of allowUngroupedWithoutPrimaryKey which sets it on the query itself, or an ability to specify it in queryRewrite()
Hi @mzealey 👋
a simple query which just returns the contents of the table without grouping etc (ie returns log-lines to the client)
I'm quite curious why would you want to do that using Cube. Wouldn't it be easier to just stream the results from ClickHouse directly?
Yes, but I'd like to use the cube acl + api interfaces. If I have to write acl+api myself then I might as well just do it all in python or similar with an ORM rather than cube.
@mzealey You can just include a primary key in this query. The ACL rule is pretty simple: if a user has access to a primary key they can do ungrouped queries.
@mzealey Did the workaround described by Pavel work for you?