Skip to content

Commit 7997e22

Browse files
committed
Respond to CRAN comments.
clean up code a bit more.
1 parent ac74e3b commit 7997e22

13 files changed

+70
-37
lines changed

DESCRIPTION

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ Authors@R: c(
99
)
1010
Maintainer: John Mount <[email protected]>
1111
URL: https://github.com/WinVector/rquery/, https://winvector.github.io/rquery/
12-
Description: Supplies a query generator based on Edgar F. Codd's relational
13-
algebra and operator names (plus experience using SQL at big data
14-
scale). The design is an attempt to make SQL more teachable by
12+
Description: A query generator based on Edgar F. Codd's relational
13+
algebra and operator names (plus experience using 'SQL' at big data
14+
scale). The design represents an attempt to make 'SQL' more teachable by
1515
denoting composition a sequential pipeline notation instead of nested
1616
queries or functions. Package features include: data processing trees
1717
or pipelines as observable objects (able to report both columns
18-
produced and columns used), optimized SQL generation as an explicit
18+
produced and columns used), optimized 'SQL' generation as an explicit
1919
user visible modeling step, and convenience methods for applying query
2020
trees to in-memory data.frames.
2121
License: GPL-3

R/package.R

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
#' \code{rquery}: Relational Query Generator for Data Manipulation
44
#'
55
#' \code{rquery} supplies a query generator based on Edgar F. Codd's relational
6-
#' algebra and operator names (plus experience using SQL at big data
7-
#' scale). The design is an attempt to make SQL more teachable by
6+
#' algebra and operator names (plus experience using \code{SQL} at big data
7+
#' scale). The design represents an attempt to make \code{SQL} more teachable by
88
#' denoting composition a sequential pipeline notation instead of nested
99
#' queries or functions. Package features include: data processing trees
1010
#' or pipelines as observable objects (able to report both columns
11-
#' produced and columns used), optimized SQL generation as an explicit
11+
#' produced and columns used), optimized \code{SQL} generation as an explicit
1212
#' user visible modeling step, and convenience methods for applying query
1313
#' trees to in-memory data.frames.
1414
#'

R/pre_sql.R

+46-2
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ pre_sql_string <- function(value) {
4444
#' represents a string constant
4545
#' value character string
4646
#'
47+
#' @param value character, token string
48+
#' @return pre_sql_token class
49+
#'
4750
#' @noRd
4851
#'
4952
pre_sql_token <- function(value) {
@@ -57,6 +60,9 @@ pre_sql_token <- function(value) {
5760
#'
5861
#' represents an expression. Unnamed list of pre_sql_terms and character.
5962
#'
63+
#' @param terms character, term vector
64+
#' @return pre_sql_expr class
65+
#'
6066
#' @noRd
6167
#'
6268
pre_sql_expr <- function(terms) {
@@ -88,6 +94,7 @@ pre_sql_expr <- function(terms) {
8894
#'
8995
#' @param tablename characer name of table
9096
#' @param columns character column names
97+
#' @return pre_sql table details
9198
#'
9299
#' @noRd
93100
#'
@@ -144,6 +151,16 @@ format.pre_sql_token <- function(x, ...) {
144151
paste(as.character(x$value), collapse = " ")
145152
}
146153

154+
#' Convert a pre_sql token object to SQL query text.
155+
#'
156+
#' @param x the pre_sql token
157+
#' @param db_info representation of the database to convert to
158+
#' @param ... force later arguments to be by name
159+
#' @param source_table concrete table for query
160+
#' @param source_limit numeric limit on rows from this source table
161+
#' @param using TBD
162+
#' @return SQL query text
163+
#'
147164
#' @noRd
148165
#'
149166
to_query.pre_sql_token <- function (x,
@@ -170,7 +187,16 @@ to_query.pre_sql_token <- function (x,
170187
paste(as.character(x$value), collapse = " ")
171188
}
172189

173-
190+
#' Convert a pre_sql expr object to SQL query text.
191+
#'
192+
#' @param x the pre_sql expr
193+
#' @param db_info representation of the database to convert to
194+
#' @param ... force later arguments to be by name
195+
#' @param source_table concrete table for query
196+
#' @param source_limit numeric limit on rows from this source table
197+
#' @param using TBD
198+
#' @return SQL query text
199+
#'
174200
#' @noRd
175201
#'
176202
to_query.pre_sql_expr <- function (x,
@@ -270,6 +296,15 @@ place_subqs <- function (x,
270296
UseMethod("place_subqs", x)
271297
}
272298

299+
#' Convert a pre_sql op object to SQL query text.
300+
#'
301+
#' @param x the pre_sql op
302+
#' @param db_info representation of the database to convert to
303+
#' @param subqs subqueries
304+
#' @param ... force later arguments to be by name
305+
#' @param source_limit numeric limit on rows from this source table
306+
#' @param using TBD
307+
#' @return SQL query text
273308
#'
274309
#' @noRd
275310
#'
@@ -285,7 +320,16 @@ place_subqs.pre_sql_op <- function (x,
285320
subqs[[1]]
286321
}
287322

288-
323+
#' Convert a pre_sql op object to SQL query text.
324+
#'
325+
#' @param x the pre_sql op
326+
#' @param db_info representation of the database to convert to
327+
#' @param ... force later arguments to be by name
328+
#' @param source_table concrete table for query
329+
#' @param source_limit numeric limit on rows from this source table
330+
#' @param using TBD
331+
#' @return SQL query text
332+
#'
289333
#' @noRd
290334
#'
291335
to_query.pre_sql_op <- function (x,

README.Rmd

-4
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,6 @@ We also can stand `rquery` up on non-`DBI` sources such as [`SparkR`](https://gi
188188
and perhaps even [`data.table`](https://github.com/WinVector/rquery/blob/master/extras/data_table.md).
189189

190190

191-
# Conclusion
192-
193-
`rquery` is still in early development (and not yet ready for extensive use in production), but it is maturing fast. Our current intent is to bring in sponsors, partners, and R community voices to help develop and steer rquery.
194-
195191

196192
```{r cleanup, include=FALSE}
197193
if(use_spark) {

README.md

-5
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,3 @@ cat(format(dq))
226226
orderby(., subjectID)
227227

228228
We also can stand `rquery` up on non-`DBI` sources such as [`SparkR`](https://github.com/WinVector/rquery/blob/master/extras/SparkRExample.md) and perhaps even [`data.table`](https://github.com/WinVector/rquery/blob/master/extras/data_table.md).
229-
230-
Conclusion
231-
==========
232-
233-
`rquery` is still in early development (and not yet ready for extensive use in production), but it is maturing fast. Our current intent is to bring in sponsors, partners, and R community voices to help develop and steer rquery.

cran-comments.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11

2+
Re-submitted with corrected spelling (entities in single quotes) in DESCRIPTION as requested.
23

34
## Test environments
45

@@ -32,4 +33,4 @@ New package, now reverse dependencies.
3233
devtools::revdep()
3334
character(0)
3435
35-
Note: "Edgar F. Codd"" and "observable" are both spelled correctly.
36+
Note: "Edgar F. Codd", "SQL", and "observable" are all spelled correctly.

docs/articles/AdHocQueries.html

+5-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/articles/AssigmentPartitioner.html

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/articles/QueryGeneration.html

+2-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/index.html

-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/reference/if_else_block.html

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/reference/rquery.html

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vignettes/QueryGeneration.Rmd

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ knitr::opts_chunk$set(
1616
)
1717
```
1818

19+
The primary purpose of `rquery` is `SQL` query generation. We demonstrate this below.
1920

2021
```{r ex, warning=FALSE, message=FALSE, include=FALSE}
2122
library("rquery")

0 commit comments

Comments
 (0)