{"id":13857904,"url":"https://github.com/hrbrmstr/sergeant-caffeinated","last_synced_at":"2025-07-18T03:39:24.748Z","repository":{"id":56198238,"uuid":"152971465","full_name":"hrbrmstr/sergeant-caffeinated","owner":"hrbrmstr","description":":guardsman: ☕️ Tools to Transform and Query Data with 'Apache' 'Drill'","archived":false,"fork":false,"pushed_at":"2020-11-21T01:32:41.000Z","size":183,"stargazers_count":7,"open_issues_count":2,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-08-06T03:04:31.296Z","etag":null,"topics":["dplyr","drill","jdbc","parquet-files","r","rstats","sql"],"latest_commit_sha":null,"homepage":"","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hrbrmstr.png","metadata":{"files":{"readme":"README.Rmd","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-10-14T12:28:44.000Z","updated_at":"2022-05-07T13:55:08.000Z","dependencies_parsed_at":"2022-08-15T14:31:22.484Z","dependency_job_id":null,"html_url":"https://github.com/hrbrmstr/sergeant-caffeinated","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hrbrmstr%2Fsergeant-caffeinated","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hrbrmstr%2Fsergeant-caffeinated/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hrbrmstr%2Fsergeant-caffeinated/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hrbrmstr%2Fsergeant-caffeinated/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hrbrmstr","download_url":"https://codeload.github.com/hrbrmstr/sergeant-caffeinated/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219858513,"owners_count":16556043,"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","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":["dplyr","drill","jdbc","parquet-files","r","rstats","sql"],"created_at":"2024-08-05T03:01:50.187Z","updated_at":"2024-10-11T21:24:02.190Z","avatar_url":"https://github.com/hrbrmstr.png","language":"R","funding_links":[],"categories":["R"],"sub_categories":[],"readme":"---\noutput: rmarkdown::github_document\neditor_options: \n  chunk_output_type: console\n---\n```{r pkg-knitr-opts, include=FALSE}\nhrbrpkghelpr::global_opts()\n```\n\n```{r badges, results='asis', echo=FALSE, cache=FALSE}\nhrbrpkghelpr::stinking_badges()\n```\n\n```{r description, results='asis', echo=FALSE, cache=FALSE}\nhrbrpkghelpr::yank_title_and_description()\n```\n\n## What's Inside The Tin\n\nThe following functions are implemented:\n\n```{r ingredients, results='asis', echo=FALSE, cache=FALSE}\nhrbrpkghelpr::describe_ingredients()\n```\n\n## Installation\n\n```{r install-ex, results='asis', eval=TRUE, echo=TRUE, cache=FALSE}\nremotes::install_github(\"hrbrmstr/sergeant-caffeinated\")\n```\n\n## Usage\n\n```{r lib-ex}\nlibrary(sergeant.caffeinated)\n\n# current version\npackageVersion(\"sergeant.caffeinated\")\n\n```\n\n```{r dplyr-01, message=FALSE}\nlibrary(tidyverse)\n\n# use localhost if running standalone on same system otherwise the host or IP of your Drill server\ntest_host \u003c- Sys.getenv(\"DRILL_TEST_HOST\", \"localhost\")\n\nbe_quiet()\n\ncon \u003c- dbConnect(drv = DrillJDBC(), sprintf(\"jdbc:drill:zk=%s\", test_host))\n\ndb \u003c- tbl(con, \"cp.`employee.json`\")\n\n# without `collect()`:\ndb %\u003e% \n  count(\n    gender, \n    marital_status\n  )\n\ndb %\u003e% \n  count(\n    gender, \n    marital_status\n  ) %\u003e% \n  collect()\n\ndb %\u003e% \n  group_by(position_title) %\u003e% \n  count(gender) -\u003e tmp2\n\ngroup_by(db, position_title) %\u003e% \n  count(gender) %\u003e% \n  ungroup() %\u003e% \n  mutate(\n    full_desc = ifelse(gender==\"F\", \"Female\", \"Male\")\n  ) %\u003e% \n  collect() %\u003e% \n  select(\n    Title = position_title, \n    Gender = full_desc, \n    Count = n\n  )\n\narrange(db, desc(employee_id)) %\u003e% print(n=20)\n\ndb %\u003e% \n  mutate(\n    position_title = tolower(position_title),\n    salary = as.numeric(salary),\n    gender = ifelse(gender == \"F\", \"Female\", \"Male\"),\n    marital_status = ifelse(marital_status == \"S\", \"Single\", \"Married\")\n  ) %\u003e%\n  group_by(supervisor_id) %\u003e% \n  summarise(\n    underlings_count = n()\n  ) %\u003e% \n  collect()\n```\n\n## sergeant Metrics\n\n```{r echo=FALSE}\ncloc::cloc_pkg_md()\n```\n\n## Code of Conduct\n\nPlease note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhrbrmstr%2Fsergeant-caffeinated","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhrbrmstr%2Fsergeant-caffeinated","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhrbrmstr%2Fsergeant-caffeinated/lists"}