简体   繁体   中英

Calcite schema around jdbc with per user fitlered tables

I need to expose for users an SQL like engine on top of specific jdbc datasource. Each user should only see a specific filtered data from this jdbc datasource.

So when a specific user runs his SQL against datasource, like:

select * from table where column = value

the engine should perform rather enhanced query:

select * from (select * from table where user = specific_user) where column = value

I have started messing around Calcite - how can achieve such logic with it? Should I add a custom view on top of JDBCSchema or try to build some new schema delegating to JDBCSchema?

Is the list of tables to be filtered (and the columns that hold the user name) known in advance? If so, you could build a JSON model file containing hand-written view definitions.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM