Add authentication when creating Hive page source
@@ -72,8 +72,8 @@ public class GenericHiveRecordCursorProvider
RecordReader<?, ?> recordReader = hdfsEnvironment.doAs(session.getUser(),
() -> HiveUtil.createRecordReader(configuration, path, start, length, schema, columns, customSplitInfo));
-
- return Optional.of(new GenericHiveRecordCursor<>(
+ return hdfsEnvironment.doAs(session.getUser(),
+ () -> Optional.of(new GenericHiveRecordCursor<>(
configuration,
path,
genericRecordReader(recordReader),
@@ -81,7 +81,7 @@ public class GenericHiveRecordCursorProvider
schema,
columns,
hiveStorageTimeZone,
- typeManager));
+ typeManager)));
}
@SuppressWarnings("unchecked")
