https://pinot.apache.org/ logo
#general
Title
# general
j

Jeff Moszuti

02/15/2022, 3:58 PM
Hey team, is there a method that will return a SQL statement as a String from a org.apache.pinot.common.request.BrokerRequest object?
k

Kishore G

02/15/2022, 6:11 PM
I dont think we have that.. why do you need that feature? we can probably add it if the use case is compelling
j

Jeff Moszuti

02/15/2022, 6:43 PM
I have a use case to host the data for multiple clients in single tables, where each table is has a discriminator column per client. I’ll like to be able to augment a SQL statement (before it is set to Pinot) to automatically append a filter predicate based the discriminator column. I’m looking to take as input a SQL statement as a string (outside of Pinot), convert it into a BrokerRequest/PinotQuery or QueryContext object where I can augment it. After augmenting it, turn the BrokerRequest/PinotQuery or QueryContext object back into a SQL string and then submit it to Pinot.
k

Kishore G

02/15/2022, 6:47 PM
Got it. This is something thats come up multiple times in case of multi-tenancy. @User @User @User what would be a good way to support this? the suggestion from @User might work but it will create dependency on some internal jars of Pinot which adds maintenance overhead.. may be, we can take additional params via rest api or query options and automatically append the additional predicate in the query?
m

Mayank

02/15/2022, 6:53 PM
Yeah, tenant isolation comes up quite often. To me it feels like something that belongs on a layer of abstraction on top of Pinot. Unless we build row level access control as a primitive in Pinot?
The way I see it, adding the predicate is first step, which can evolve into adding authenticaiton/authorization support as well.
k

Kishore G

02/15/2022, 6:54 PM
Let’s create a GitHub issue and continue the discussion there
m

Mayank

02/15/2022, 6:54 PM
I think we might have one. Let me find and link here.
j

Jeff Moszuti

02/16/2022, 9:31 AM
Thanks guys