Forum Stats

  • 3,750,525 Users
  • 2,250,188 Discussions
  • 7,866,998 Comments

Discussions

sourceCpp and embedded script

User_1RHVH
User_1RHVH Member Posts: 3 Green Ribbon
edited Apr 17, 2020 9:20PM in R Technologies

Hi,

I have an R script which runs perfectly on the server in an ORE environment. It uses the Rcpp package to create C++ objects and uses the sourceCpp function to call the C++ object script.

However, when I embed to exact same script for embedded R execution I get the following error:

ORA-20000: RQuery error

Error in system(cmd, ignore.stderr = TRUE, intern = TRUE) :

  error in running command

ORA-06512: at "RQSYS.RQEVALIMPL", line 104

ORA-06512: at "RQSYS.RQEVALIMPL", line 101

20000. 00000 -  "%s"

*Cause:    The stored procedure 'raise_application_error'

           was called which causes this error to be generated.

*Action:   Correct the problem as described in the error message or contact

           the application administrator or DBA for more information.

I have the RQADMIN role privilege.

I am unable to ascertain exactly what the 'cmd' variable may be as my R skills are limited and it appears buried in the package.

Why does this run in my ORE environment with a unix account and not with my Oracle account?

Any help on this would be appreciated.

Kind Regards

Sherry Lamonica-Oracle

Answers

  • Sherry Lamonica-Oracle
    Sherry Lamonica-Oracle Posts: 437 Employee
    edited Apr 14, 2020 4:20PM

    The problem is caused by Rcpp package calls to R's system() function  to build a shared library  e.g. system("R CMD SHLIB ...") . Specifically, this fails when the "R CMD SHLIB" call runs inside of ORE's embedded R execution because it calls a second R session, recursively calling R.  Recursive calls to R are not supported in ORE's embedded R execution due to a Database limitation.

    Sherry

  • User_1RHVH
    User_1RHVH Member Posts: 3 Green Ribbon
    edited Apr 17, 2020 2:20AM

    Hi Sherry,

    Thank you so much for your reply. Following on from this, is there any chance this may be resolved? I imagine lots of users would want to use the Rcpp package. Do you have any information on ORD 3.4.4? I have followed the link to https://oss.oracle.com/ORD/ but cannot find the software. What are the upgrade plans?

    Kind Regards

    Scott

  • Sherry Lamonica-Oracle
    Sherry Lamonica-Oracle Posts: 437 Employee
    edited Apr 17, 2020 11:34AM

    Hi Scott,

    This happens when a table function invokes another table function or external procedure. This is a limitation of Oracle Database itself and not Oracle Machine Learning for R (formerly ORE). I'll contact the team responsible for this functionality with this request for a future Database release.

    Oracle R Distribution 3.4.4 for Linux is out on Oracle's public yum, and Oracle R Distribution 3.6.1 for Linux, Windows, AIX and Solaris SPARC 64-bit will be released in the coming weeks.

    Hope it helps.

    Sherry

  • User_1RHVH
    User_1RHVH Member Posts: 3 Green Ribbon
    edited Apr 17, 2020 9:20PM

    Hi Sherry,

    This does help. Thank you again for taking the time to respond and it would be very exciting if the request for new functionality is realised.

    I look forward to working with ORD 3.6.1 as I have a number of packages that I would love to install rather than pick apart.

    Kind Regards

    Scott

    Sherry Lamonica-Oracle