Github user chunhui-shi commented on a diff in the pull request:
https://github.com/apache/drill/pull/1032#discussion_r151299650
--- Diff:
exec/java-exec/src/main/java/org/apache/drill/exec/store/SchemaTreeProvider.java
---
@@ -105,12 +106,36 @@ public SchemaPlus createRootSchema(final String
userName, final SchemaConfigInfo
* @return
*/
public SchemaPlus createRootSchema(SchemaConfig schemaConfig) {
+ final SchemaPlus rootSchema =
DynamicSchema.createRootSchema(dContext.getStorage(), schemaConfig);
+ schemaTreesToClose.add(rootSchema);
+ return rootSchema;
+ }
+
+ /**
+ * Return full root schema with schema owner as the given user.
+ *
+ * @param userName Name of the user who is accessing the storage sources.
+ * @param provider {@link SchemaConfigInfoProvider} instance
+ * @return Root of the schema tree.
+ */
+ public SchemaPlus createFullRootSchema(final String userName, final
SchemaConfigInfoProvider provider) {
+ final String schemaUser = isImpersonationEnabled ? userName :
ImpersonationUtil.getProcessUserName();
--- End diff --
not that many places, and need to pass in isImpersonationEnabled and
userName if this line became a standalone method. will keep it as is for now.
---