Which R code segment should you use?

You plan to analyze data on a local computer. To improve performance, you plan to alternate the operation
between a Microsoft SQL Server and the local computer.
You need to run complex code on the SQL Server, and then revert to the local compute context.
Which R code segment should you use?

You plan to analyze data on a local computer. To improve performance, you plan to alternate the operation
between a Microsoft SQL Server and the local computer.
You need to run complex code on the SQL Server, and then revert to the local compute context.
Which R code segment should you use?

A.
sqlCompute <- RxInSqlServer(connectionString = “Driver=SQL Server;Server = myServer; Database =
TestDB; Uid = myID; Pwd = myPwd;”)sqlPackagePaths <- RxFindPackage(package = “RevoScaleR”,
computeContext = sqlServerCompute)

B.
sqlCompute <- RxInSqlServer(connectionstring = sqlConnString, shareDir = sqlShareDir,wait = sqlWait,
consoleOutput = sqlConsoleOutput)rxSetComputeContext(“local”)x <- 1:10rxExec(print, x, elemType =
“cores”, timesToRun = 10)rxSetComputeContext(“RxLocalParallel”)

C.
sqlCompute <- RxInSqlServer(connectionstring = sqlConnString, shareDir = sqlShareDir,wait = sqlWait,
consoleOutput = sqlConsoleOutput)rxSetComputeContext(“sqlCompute”)x <- 1:10rxExec(print, x, elemType
= “cores”, timesToRun = 10)rxSetComputeContext(“local”)

D.
sqlCompute <- RxInSqlServer(connectionstring = sqlConnString, shareDir = sqlShareDir,wait = sqlWait,
consoleOutput = sqlConsoleOutput)rxSetComputeContext(“local”)x <- 1:10rxExec(print, x, elemType =
“cores”, timesToRun = 10)rxSetComputeContext(“sqlCompute”)

Explanation:
https://docs.microsoft.com/en-us/sql/advanced-analytics/tutorials/deepdive-define-and-usecompute-contexts



Leave a Reply 1

Your email address will not be published. Required fields are marked *