cgivre commented on code in PR #2516: URL: https://github.com/apache/drill/pull/2516#discussion_r855380007
########## contrib/storage-jdbc/src/main/java/org/apache/drill/exec/store/jdbc/JdbcScanBatchCreator.java: ########## @@ -55,14 +57,22 @@ public CloseableRecordBatch getBatch(ExecutorFragmentContext context, } } - private ScanFrameworkBuilder createBuilder(OptionManager options, JdbcSubScan subScan) { - JdbcStorageConfig config = subScan.getConfig(); + private ScanFrameworkBuilder createBuilder(ExecutorFragmentContext context, JdbcSubScan subScan) { ScanFrameworkBuilder builder = new ScanFrameworkBuilder(); builder.projection(subScan.getColumns()); builder.setUserName(subScan.getUserName()); JdbcStoragePlugin plugin = subScan.getPlugin(); - List<ManagedReader<SchemaNegotiator>> readers = - Collections.singletonList(new JdbcBatchReader(plugin.getDataSource(), subScan.getSql(), subScan.getColumns())); + UserCredentials userCreds = context.getContextInformation().getQueryUserCredentials(); + DataSource ds = plugin.getDataSource(userCreds) + .orElseThrow(() -> UserException.permissionError().message( + "Query user %s could obtain a connection to %s, missing credentials?", Review Comment: Fixed. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@drill.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org