SQL 2016 R Syntax?

  • Ernest Libertucci

    Ten Centuries

    Points: 1334

    I can't find documentation for the R-Integration features. Could anyone point me in the right direction to get the syntax for this? Our Data Science team is chomping at the bit to try this out and I'm coming up empty.

  • Alan Burstein

    SSC Guru

    Points: 61019

    Check this:

    http://blog.revolutionanalytics.com/2015/05/r-in-sql-server.html

    -- Alan Burstein


    Helpful links:Best practices for getting help on SQLServerCentral -- Jeff ModenHow to Post Performance Problems -- Gail ShawNasty fast set-based string manipulation functions:For splitting strings try DelimitedSplit8K or DelimitedSplit8K_LEAD (SQL Server 2012+)To split strings based on patterns try PatternSplitCMNeed to clean or transform a string? try NGrams, PatExclude8K, PatReplace8K, DigitsOnlyEE, or Translate8KI cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code.  -- Itzik Ben-Gan 2001

  • Jeff Moden

    SSC Guru

    Points: 993897

    And still.... even after all of that, nothing to handle true CSV with text qualifiers that work for the way that Excel exports CSV or even TSV. What a pity. Guess I'll keep doing it the old fashioned way.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
    "If you think its expensive to hire a professional to do the job, wait until you hire an amateur."--Red Adair
    "Change is inevitable... change for the better is not."
    When you put the right degree of spin on it, the number 3|8 is also a glyph that describes the nature of a DBAs job. 😉

    Helpful Links:
    How to post code problems

  • manub22

    Hall of Fame

    Points: 3133

    "R" was not part of CTP2 release of SQL Server 2016.

    It might be coming with the CTP3 release or with the RTM, and followed by the MSDN/Technet articles.

  • Ernest Libertucci

    Ten Centuries

    Points: 1334

    Thank you, that would explain it!

    manub22 (6/16/2015)


    "R" was not part of CTP2 release of SQL Server 2016.

    It might be coming with the CTP3 release or with the RTM, and followed by the MSDN/Technet articles.

  • anthony.green

    SSC Guru

    Points: 112212

    R is in CTP3

    http://www.theregister.co.uk/2015/10/28/sql_server_2016_with_r/



    How to post data/code for the best help - Jeff Moden[/url]
    Need a string splitter, try this - Jeff Moden[/url]
    How to post performance problems - Gail Shaw[/url]
    Managing Transaction Logs - Gail Shaw[/url]
    Troubleshooting SQL Server: A Guide for the Accidental DBA - Jonathan Kehayias and Ted Krueger[/url]

  • manub22

    Hall of Fame

    Points: 3133

    You can test the R integration with SQL Server 2016 now, as its has been released with the beta/preview version i.e. CTP 3.

    Check here: http://blogs.technet.com/b/dataplatforminsider/archive/2015/10/28/sql-server-2016-community-technology-preview-3-0-is-available.aspx

  • Ernest Libertucci

    Ten Centuries

    Points: 1334

    Thanks very much for the head's up.

    I have installed CTP 3, and followed the MS instructions for enabling R (including the other installers), but I'm hitting a brick wall when attempting to run a simple test R script. If anyone has seen the below error or could give any pointers, I would be very appreciative.

    Test script:

    EXECUTE sp_execute_external_script

    @language = N'R'

    , @script = N'OutputDataSet <- data.frame(mean(InputDataSet[,1]))'

    , @input_data_1 = N'SELECT 50 as L_Quantity '

    WITH RESULT SETS ((col int not null));

    Results:

    Msg 39021, Level 16, State 1, Line 1

    Unable to launch runtime for 'R' script. Please check the configuration of the 'R' runtime.

    Msg 39019, Level 16, State 1, Line 1

    An external script error occurred:

    Unable to launch the runtime. ErrorCode 0x80070490: 1168(Element not found.).

  • Ernest Libertucci

    Ten Centuries

    Points: 1334

    If anyone else runs into issues with this, I believe that the order you install things matters. I was able to get a working R install by going in the following order:

    1) R runtime

    2) R enterprise Node

    3) SQL 2016 with R Extensions

    4) Run the sp_configure script

    5) Finally, run the command line script

    Persistence is key!

    Ernest Libertucci (11/1/2015)


    Thanks very much for the head's up.

    I have installed CTP 3, and followed the MS instructions for enabling R (including the other installers), but I'm hitting a brick wall when attempting to run a simple test R script. If anyone has seen the below error or could give any pointers, I would be very appreciative.

    Test script:

    EXECUTE sp_execute_external_script

    @language = N'R'

    , @script = N'OutputDataSet <- data.frame(mean(InputDataSet[,1]))'

    , @input_data_1 = N'SELECT 50 as L_Quantity '

    WITH RESULT SETS ((col int not null));

    Results:

    Msg 39021, Level 16, State 1, Line 1

    Unable to launch runtime for 'R' script. Please check the configuration of the 'R' runtime.

    Msg 39019, Level 16, State 1, Line 1

    An external script error occurred:

    Unable to launch the runtime. ErrorCode 0x80070490: 1168(Element not found.).

Viewing 9 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic. Login to reply