Fail to load library in r script on sql server 2016

2

I am having big trouble using the ncdf4-package in an R-script on SQL server 2016. I have a long script, but everything boils down to these lines:

EXEC sp_execute_external_script  @language =N'R',
@script=N'library(ncdf4)'
GO

Which give me the error:

Msg 39004, Level 16, State 20, Line 10 A 'R' script error occurred during execution of 'sp_execute_external_script' with HRESULT 0x80004004. Msg 39019, Level 16, State 1, Line 10 An external script error occurred:

Invalid BXL stream"

The package is installed in the right place. Ran this script to verify:

EXECUTE sp_execute_external_script
@language=N'R'  
,@script = N'str(OutputDataSet);  
packagematrix <- installed.packages();  
NameOnly <- packagematrix[,1];  
OutputDataSet <- as.data.frame(NameOnly);'  
,@input_data_1 = N'SELECT 1 as col'  
WITH RESULT SETS ((PackageName nvarchar(250) ))

The package name shows on the list. It is totally impossible to load the package. I have ran several other packages with no problems, so i think the permissions are ok. SQL Server 2016 runs on a virtual machine with 14 Gb ram and I have allocated up to 75% of the memory to the program with this line of code:

ALTER RESOURCE POOL "default" WITH (max_memory_percent = 75);

So I cannot imagine that this is due to memory limits. 84% of the ram is free. It works on RStudio. Plees help

sql-server
r
packages
asked on Stack Overflow Nov 3, 2017 by squiRt

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0