DRILL-3037: Fix impersonation issue with HDFS based filesystem plugins. We have common code where we impersonate the owner of scan (proxy us…
DRILL-3037: Fix impersonation issue with HDFS based filesystem plugins.We have common code where we impersonate the owner of scan (proxy user) while creatinga filesystem object. When impersonation is enabled the proxy user is either queryuser or view owner (if the query involves views). When impersonation is disabled theproxy user is always the user who started Drillbit (processUser). This causes problemsas "processUser" tries to impersonate "processUser" when impersonation is disabled.HDFS based filesystems which have impersonation disabled prohibit this (even the selfimpersonation).Fix is don't impersonate "processUser". If the given proxy user name is same as"processUser", then return the process UserGroupInformation directly instead ofproxy UserGroupInformation.