{"id":19723136,"url":"https://github.com/bnosac/spark.sas7bdat","last_synced_at":"2025-10-24T03:42:10.613Z","repository":{"id":48886577,"uuid":"63812100","full_name":"bnosac/spark.sas7bdat","owner":"bnosac","description":"Read in SAS data in parallel into Apache Spark","archived":false,"fork":false,"pushed_at":"2021-07-07T03:56:12.000Z","size":21,"stargazers_count":26,"open_issues_count":3,"forks_count":7,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-28T10:06:24.174Z","etag":null,"topics":["r","sas7bdat","spark","sparklyr"],"latest_commit_sha":null,"homepage":null,"language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bnosac.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-07-20T20:25:46.000Z","updated_at":"2023-07-03T18:52:03.000Z","dependencies_parsed_at":"2022-09-16T04:30:48.552Z","dependency_job_id":null,"html_url":"https://github.com/bnosac/spark.sas7bdat","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/bnosac/spark.sas7bdat","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bnosac%2Fspark.sas7bdat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bnosac%2Fspark.sas7bdat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bnosac%2Fspark.sas7bdat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bnosac%2Fspark.sas7bdat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bnosac","download_url":"https://codeload.github.com/bnosac/spark.sas7bdat/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bnosac%2Fspark.sas7bdat/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271430906,"owners_count":24758419,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-21T02:00:08.990Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["r","sas7bdat","spark","sparklyr"],"created_at":"2024-11-11T23:19:40.464Z","updated_at":"2025-10-24T03:42:10.524Z","avatar_url":"https://github.com/bnosac.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"# spark.sas7bdat\n\nThe  **spark.sas7bdat** package allows R users working with [Apache Spark](https://spark.apache.org) to read in [SAS](https://www.sas.com) datasets in .sas7bdat format into Spark by using the [spark-sas7bdat Spark package](https://spark-packages.org/package/saurfang/spark-sas7bdat). This allows R users to \n\n- load a SAS dataset in parallel into a Spark table for further processing with the [sparklyr](https://cran.r-project.org/package=sparklyr) package\n- process in parallel the full SAS dataset with dplyr statements, instead of having to import the full SAS dataset in RAM (using the foreign/haven packages) and hence avoiding RAM problems of large imports\n\n\n## Example\nThe following example reads in a file called iris.sas7bdat in a table called sas_example in Spark. Do try this with bigger data on your cluster and look at the help of the [sparklyr](https://github.com/sparklyr/sparklyr) package to connect to your Spark cluster.\n\n```r\nlibrary(sparklyr)\nlibrary(spark.sas7bdat)\nmysasfile \u003c- system.file(\"extdata\", \"iris.sas7bdat\", package = \"spark.sas7bdat\")\n\nsc \u003c- spark_connect(master = \"local\")\nx \u003c- spark_read_sas(sc, path = mysasfile, table = \"sas_example\")\nx\n```\n\nThe resulting pointer to a Spark table can be further used in dplyr statements\n```r\nlibrary(dplyr)\nx %\u003e% group_by(Species) %\u003e%\n  summarise(count = n(), length = mean(Sepal_Length), width = mean(Sepal_Width))\n```\n\n## Installation\n\nInstall the package from CRAN.\n```\ninstall.packages('spark.sas7bdat')\n```\n\nOr install this development version from github.\n```\ndevtools::install_github(\"bnosac/spark.sas7bdat\", build_vignettes = TRUE)\nvignette(\"spark_sas7bdat_examples\", package = \"spark.sas7bdat\")\n```\n\nThe package has been tested out with Spark version 2.0.1 and Hadoop 2.7.\n```\nlibrary(sparklyr)\nspark_install(version = \"2.0.1\", hadoop_version = \"2.7\")\n```\n\n## Speed comparison\n\nIn order to compare the functionality to the read_sas function from the [haven](https://cran.r-project.org/package=haven) package, below we show a comparison on a small 5234557 rows x 2 columns SAS dataset with only numeric data. Processing is done on 8 cores. With the haven package you need to import the data in RAM, with the spark.sas7bdat package, you can immediately execute dplyr statements on top of the SAS dataset.\n\n```r\nmysasfile \u003c- \"/home/bnosac/Desktop/testdata.sas7bdat\"\nsystem.time(x \u003c- spark_read_sas(sc, path = mysasfile, table = \"testdata\"))\n   user  system elapsed \n  0.008   0.000   0.051 \nsystem.time(x \u003c- haven::read_sas(mysasfile))\n   user  system elapsed \n  1.172   0.032   1.200 \n```\n\n## Support in big data and Spark analysis\n\nNeed support in big data and Spark analysis?\nContact BNOSAC: http://www.bnosac.be\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbnosac%2Fspark.sas7bdat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbnosac%2Fspark.sas7bdat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbnosac%2Fspark.sas7bdat/lists"}