How to use rxExec to run standard R remote?

2019-03-01 16:01发布

I'm trying to call the Standard R code via the function "rxExec" to execute the code remote.

My compute context is RxInSqlServer() and the connection to the server is fine.

Is this call possible in general? Or is there a better way to perform Standard R remote via SQL R Server Services?

function1 <- function(varIn,varOut) {
  df<- rxImport(varIn)
  df<- ... [STANDARD R CODE]
  rxDataStep(inData = df,
             outFile = varOut
             numRows=1000)
}

rxSetComputeContext(cc)

sql <- "SELECT * FROM ..."
dbIn <- RxSqlServerData(sqlQuery = sql,
                                connectionString = conn)
dbOut <- RxSqlServerData(table = "nameTable",
                           connectionString = conn)

rxExec(function1, varIn = dbIn, varOut = dbOut) 

With a similar example, but without writting the Data-Output i a table only with a return value I get the same error

function1 <- function(varIn) {
  df<- rxImport(varIn)
  df<- ... [STANDARD R CODE]
  return(data)
}

rxSetComputeContext(cc)

sql <- "SELECT * FROM ..."
dbIn <- RxSqlServerData(sqlQuery = sql,
                                connectionString = conn)

x<- rxExec(function1, varIn = dbIn) 

Error message: Warning: namespace 'CompatibilityAPI' is not available and has been replaced by .GlobalEnv when processing object 'inputObject'

Error in slot(from, what) : no slot of name "maxColWidth" for this object of class "RxSqlServerData" Calls: source ... anyStrings -> validityMethod -> as -> asMethod -> slot Execution halted

Error in rxCompleteClusterJob(hpcServerJob, consoleOutput, autoCleanup) : No results available - final job state: failed

Thanks!

标签: r microsoft-r
0条回答
登录 后发表回答