Skip to content

Latest commit

 

History

History
96 lines (69 loc) · 4.23 KB

custom-runtime-r.md

File metadata and controls

96 lines (69 loc) · 4.23 KB
title description author ms.author ms.date ms.service ms.subservice ms.topic ms.custom zone_pivot_groups monikerRange
Install R custom runtime
Learn how to install an R custom runtime for SQL Server using Language Extensions. The Python custom runtime can run machine learning scripts.
VanMSFT
vanto
11/09/2022
sql
machine-learning-services
how-to
intro-installation, linux-related-content
sqlml-platforms
=sql-server-ver15||=sql-server-linux-ver15

Install an R custom runtime for SQL Server

[!INCLUDE SQL Server 2019 and later]

Learn how to install an R custom runtime for running external R scripts with SQL Server on:

  • Windows
  • Ubuntu Linux
  • Red Hat Enterprise Linux (RHEL)
  • SUSE Linux Enterprise Server (SLES) version 12

The custom runtime can run machine learning scripts and uses the SQL Server Language Extensions.

Use your own version of the R runtime with SQL Server, instead of the default runtime version installed with SQL Server Machine Learning Services.

Beginning with [!INCLUDE sssql22-md], runtimes for R, Python, and Java, are no longer installed with SQL Setup. Instead, install your desired R custom runtime(s) and packages. For more information, see Install SQL Server 2022 Machine Learning Services (Python and R) on Windows or Install SQL Server Machine Learning Services (Python and R) on Linux.

::: zone pivot="platform-windows" [!INCLUDE R custom runtime - Windows] ::: zone-end

::: zone pivot="platform-linux-ubuntu" [!INCLUDE R custom runtime - Linux - Prerequisites]

[!INCLUDE R custom runtime - Linux - Ubuntu specific steps]

[!INCLUDE R custom runtime on Linux - Common steps] ::: zone-end

::: zone pivot="platform-linux-rhel" [!INCLUDE R custom runtime - Linux - Prerequisites]

[!INCLUDE R custom runtime - Linux - RHEL specific steps]

[!INCLUDE R custom runtime on Linux - Common steps] ::: zone-end

::: zone pivot="platform-linux-sles" [!INCLUDE R custom runtime - Linux - Prerequisites]

[!INCLUDE R custom runtime - Linux - SLES specific steps]

[!INCLUDE R custom runtime on Linux - Common steps] ::: zone-end

Enable external script

You can execute an R external script with the stored procedure sp_execute_external script.

To enable external scripts, use Azure Data Studio to execute the statement below.

sp_configure 'external scripts enabled', 1;
RECONFIGURE WITH OVERRIDE;  

Verify installation

Use the following SQL script to verify the installation and functionality of the R custom runtime. In the below sample script, myR is used as the language name because the default language name R cannot be provided for a custom runtime.

EXEC sp_execute_external_script
    @language =N'myR',
    @script=N'
print(R.home());
print(file.path(R.home("bin"), "R"));
print(R.version);
print("Hello RExtension!");'

::: zone pivot="platform-windows" [!INCLUDE R custom runtime - Windows - known issues] ::: zone-end

::: zone pivot="platform-linux-rhel" [!INCLUDE R custom runtime - Linux - RHEL known issues] ::: zone-end

Next steps