You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pig.apache.org by Jarred Li <ja...@gmail.com> on 2012/04/19 10:33:11 UTC

How to enable impersonation in Pig

Hi All,

In MapReduce or HDFS, we can enable impersonation with following code:

 UserGroupInformation ugi =
            UserGroupInformation.createProxyUser("user2",
UserGroupInformation.getLoginUser());
    ugi.doAs(new PrivilegedExceptionAction<Void>() {
      public Void run() throws Exception {
          Job job = new Job(conf, "word count");
            ...
      }
    });

How can I enable impersonation in Pig?

Thanks!