Set HDFS username in native libhdfs
@@ -509,6 +509,11 @@ hdfsFS hdfsBuilderConnect(struct hdfsBuilder *bld)
}
}
+ const char* hdfs_user = getenv("HDFS_USER");
+ if (hdfs_user != NULL && bld->userName == NULL) {
+ bld->userName = hdfs_user;
+ }
+
//Check what type of FileSystem the caller wants...
if (bld->nn == NULL) {
// Get a local filesystem.
