microsoft / sqlmlutils

Utility functions for easier usage of SQL Server Machine Learning Services
Other
32 stars 33 forks source link

R module installation on SQL Managed Instance #106

Closed AllenSuttonValocity closed 1 year ago

AllenSuttonValocity commented 1 year ago

I am using sqlmlutils to install R modules onto SQL Managed instance in Azure

The particular issue that I have is that although the log output for the installation of data.table shows as Version 1.14.6 being downloaded,

2022-11-21 15:04:11.81 Starting package install on SQL server (Driver=SQL Server;Server=;Database=master;uid=;pwd=;)... 2022-11-21 15:04:11.81 Verifying permissions to install packages on SQL server... 2022-11-21 15:04:22.92 Resolving package dependencies for (data.table)... 2022-11-21 15:04:25.88 Downloading package [1/1] data.table (1.14.6)... 2022-11-21 15:04:29.99 Copying package to Sql server [1/1] data.table... 2022-11-21 15:04:32.59 Installing packages to library path, this may take some time... 2022-11-21 15:04:34.79 Successfully installed packages on SQL server (data.table).

from SQL query after module installation, version reported is 1.12.8 (installed into C:/WFRoot/DB8C.1/Fabric/work/Applications/Worker.CL_App14/work/Data/ExternalLibraries/32763/1/1 while all other modules are in C:/WFRoot/Ext/R.9.4.7.1185/library)

Is there any way to get data.table 1.14.6 installed on SQL Managed instance as we'd like to use some of the most recent functions?

seantleonard commented 1 year ago

Hi @AllenSuttonValocity ,

I'm sorry for the delayed response.

SQL Managed Instance uses R 3.5.2. Consequentially, when sqlmlutils resolves which Windows binary package to download from CRAN, sqlmlutils uses the binary listed on https://cran.rstudio.com/bin/windows/contrib/3.5/ which is version 1.12.8.

There is a workaround. However, while writing the instructions, I uncovered a bug with how a package name is parsed from a zipped R binary. I'm working on a fix.

Once fixed, the work-around to install the most recent version of data.table for R 3.5.2, would be to build a binary for R3.5.2 from source. You will need to have rtools35 to build from source, locally. Once built, you would be able to use sqlmlutils to upload the zipped binary.