cube icon indicating copy to clipboard operation
cube copied to clipboard

allowUngroupedWithoutPrimaryKey on a per-cube or view basis?

Open mzealey opened this issue 4 months ago • 4 comments

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()

mzealey avatar Mar 05 '24 14:03 mzealey

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?

igorlukanin avatar Mar 20 '24 15:03 igorlukanin

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 avatar Mar 20 '24 15:03 mzealey

@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.

paveltiunov avatar Mar 24 '24 22:03 paveltiunov

@mzealey Did the workaround described by Pavel work for you?

igorlukanin avatar May 14 '24 10:05 igorlukanin