Baoqi commented on issue #908: #864 Hive datasource support set role URL: https://github.com/apache/incubator-dolphinscheduler/pull/908#issuecomment-544773803 > > > > I don't think use a special key value pair in database connection parameter is a good solution. Because those parameters are used for JDBC driver. and should only be understandable by JDBC Drivers. > > > > Can "PreStatement" ("前置sql") in SQL Task works for you? You can add "set role admin" as PreStatement > > > > > > > > > It needs to be run before "add jar xxx" and "create func...xxx". But "PreStatement" is after that. > > > > > > Hi, gary, yes, in this case, can we just change the order of function calls? > > > > 1. first call pre-statement > > 2. call create func.. > > 3. execute normal sql > > 4. call post-statement > > > > Seems this is better than set an parameter for data source. > > I'm agreed with you,so I tried pre-statement at the first time. Then I realized I might be wrong, change the order of function calls will change the pre-statement's goals.(e.g. using UDF in pre-statement SQL will faild). > I don't know which is the better way. So I chose a way of making the least impact changes. > Can the official commiters give some advice? Hi, Gary, I think pre-statement should mostly used to setup environment for the main SQL. so, it is used mainly for: like setup locale, setup timezone, drop some partition, create partition if not exists, etc. In most case, I don't think we need to refer to UDF in those pre-Statement. I added those "pre-statement", and "post statement" support, so I think it is fine to change pre-statement to run before register UDFs. So, I think you can go ahead and change that and make a Pull request. Thanks.
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
