Hi,
Sounds like you are asking to have the default schema be an attribute of the 
user. Each time I log in, I get the "customer" schema, while each time you log 
in, you get the "sales" schema. Correct?

At present, Drill has no concept of a user as an entity. Drill can perform user 
authentication using an external system. But, unlike, say, Oracle or MySql, 
Drill maintains no per-user properties.

Could such a feature be added? Certainly. Perhaps the data could be stored as a 
LDAP attribute. Perhaps Drill could keep this information in ZooKeeper. Or, 
once Drill has a metastore, user attributes could be stored there as well.

Or, are you asking that a particular schema be the default for everyone in all 
sessions? That is, when either you or I log in, we are both presented with the 
"customer" schema as the default. Again, this is not possible today, but a 
global setting fits within Drill's existing code: just enhance the session 
initiation code to consult a new System option for the global default schema.


I would recommend filing a JIRA enhancement to track this use case, whichever 
is the one you want. And, if you need this feature, please consider 
implementing it and offering it as a pull request.


Note that a related request would be session attributes related to tables (or 
files or schemas). For example, the "all text mode" for JSON is a session 
attribute. If I have file a.json that needs this mode, but file b.json that 
does not, I have to remember to turn "all text mode" on and off as I switch 
between files. Would be very helpful if the "all text mode" setting was an 
attribute of the file, and if Drill would then enable/disable it automatically 
when I query that file.

Again, today there is no good place to store that information (other than in 
the script running queries or in the user's head.) Again, once Drill has a 
metastore of some kind, session options could become a property of a 
table/file/schema.

Thanks,
- Paul

 

    On Saturday, August 11, 2018, 12:31:11 AM PDT, dsaivarunvishal reddy 
<saivarunvis...@gmail.com> wrote:  
 
 USE schema; would change the default schema for the current session, it
would be useful if we can have ability to change the default schema to look
into through out all sessions.
  

Reply via email to