@@ -376,29 +376,39 @@ The following provides some sample code on use of the new functions:
376376myHadoopCluster <- rxSparkConnect(reset = TRUE)
377377
378378
379+ ```
380+ #..create a Spark compute context
381+
382+ myHadoopCluster <- rxSparkConnect(reset = TRUE)
383+ rxSetComputeContext(myHadoopCluster)
384+ ```
385+
386+
379387```
380388#..retrieve some sample data from Hive and run a model
381389
382390hiveData <- RxHiveData("select * from hivesampletable",
383391 colInfo = list(devicemake = list(type = "factor")))
384392rxGetInfo(hiveData, getVarInfo = TRUE)
385393
386- rxSetComputeContext(myHadoopCluster)
387394rxLinMod(querydwelltime ~ devicemake, data=hiveData)
388395```
389396
397+
390398```
391- #..retrieve some sample data from Parquet and run a model
392- pqData <- RxParquetData("/share/SampleData/AirlineDemoSmallParquet")
393- rxGetInfo(pqData, getVarInfo = TRUE)
399+ #..retrieve some sample data from Parquet and run a model
394400
395- rxSetComputeContext(myHadoopCluster)
396- rxLinMod(ArrDelay~CRSDepTime + DayOfWeek, data = pqData)
397- ```
398-
401+ pqData <- RxParquetData("/share/SampleData/AirlineDemoSmallParquet",
402+ colInfo = list(DayOfWeek = list(type = "factor")))
403+ rxGetInfo(pqData, getVarInfo = TRUE)
399404
405+ rxLinMod(ArrDelay~CRSDepTime + DayOfWeek, data = pqData)
400406```
401- #..check on Spark data objects, cleanup, and close the Spark session
407+
408+
409+ ```
410+ #..check on Spark data objects, cleanup, and close the Spark session
411+
402412ls <- rxSparkListData() # two data objs are cached
403413rxSparkRemoveData(ls)
404414rxSparkListData() # it should show empty list
0 commit comments