Skip to content

Commit

Permalink
Adds Spark dialect (without updated SqlRender JAR file)
Browse files Browse the repository at this point in the history
  • Loading branch information
alondhe committed Apr 16, 2021
1 parent 53bdac3 commit 332598a
Show file tree
Hide file tree
Showing 46 changed files with 952 additions and 259 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ standalone/build/*
.idea
*.iml
errorReportSql.txt
.DS_Store
60 changes: 30 additions & 30 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
Package: SqlRender
Type: Package
Title: Rendering Parameterized SQL and Translation to Dialects
Version: 1.7.0
Date: 2021-03-01
Authors@R: c(
person("Martijn", "Schuemie", , "[email protected]", role = c("aut", "cre")),
person("Marc", "Suchard", role = c("aut"))
)
Maintainer: Martijn Schuemie <[email protected]>
Description: A rendering tool for parameterized SQL that also translates into
different SQL dialects. These dialects include 'Microsoft Sql Server', 'Oracle',
'PostgreSql', 'Amazon RedShift', 'Apache Impala', 'IBM Netezza', 'Google BigQuery', 'Microsoft PDW', and 'SQLite'.
SystemRequirements: Java version 8 or higher (https://www.java.com/)
License: Apache License 2.0
VignetteBuilder: knitr
URL: https://ohdsi.github.io/SqlRender/, https://github.com/OHDSI/SqlRender
BugReports: https://github.com/OHDSI/SqlRender/issues
Imports:
rJava,
rlang
Suggests:
testthat,
knitr,
rmarkdown,
shiny,
shinydashboard
LazyData: false
RoxygenNote: 7.1.1
Encoding: UTF-8
Package: SqlRender
Type: Package
Title: Rendering Parameterized SQL and Translation to Dialects
Version: 1.7.0
Date: 2021-03-01
Authors@R: c(
person("Martijn", "Schuemie", , "[email protected]", role = c("aut", "cre")),
person("Marc", "Suchard", role = c("aut"))
)
Maintainer: Martijn Schuemie <[email protected]>
Description: A rendering tool for parameterized SQL that also translates into
different SQL dialects. These dialects include 'Microsoft Sql Server', 'Oracle',
'PostgreSql', 'Amazon RedShift', 'Apache Impala', 'IBM Netezza', 'Google BigQuery', 'Microsoft PDW', 'Apache Spark', and 'SQLite'.
SystemRequirements: Java version 8 or higher (https://www.java.com/)
License: Apache License 2.0
VignetteBuilder: knitr
URL: https://ohdsi.github.io/SqlRender/, https://github.com/OHDSI/SqlRender
BugReports: https://github.com/OHDSI/SqlRender/issues
Imports:
rJava,
rlang
Suggests:
testthat,
knitr,
rmarkdown,
shiny,
shinydashboard
LazyData: false
RoxygenNote: 7.1.1
Encoding: UTF-8
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ Changes:

3. Updated `createRWrapperForSql()` to latest SqlRender standards.

4. Added Apache Spark dialect ("spark")

Bugfixes:

1. Fixed translation of CTE without FROM or UNION in BigQuery.
Expand Down
2 changes: 1 addition & 1 deletion R/HelperFunctions.R
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ renderSqlFile <- function(sourceFile, targetFile, warnOnMissingParameters = TRUE
#' @param sourceFile The source SQL file
#' @param targetFile The target SQL file
#' @param targetDialect The target dialect. Currently "oracle", "postgresql", "pdw", "impala",
#' "sqlite", "netezza", "bigquery", and "redshift" are supported.
#' "sqlite", "netezza", "bigquery", "spark", and "redshift" are supported.
#' @param oracleTempSchema DEPRECATED: use \code{tempEmulationSchema} instead.
#' @param tempEmulationSchema Some database platforms like Oracle and Impala do not truly support
#' temp tables. To emulate temp tables, provide a schema with write
Expand Down
6 changes: 3 additions & 3 deletions R/RenderSql.R
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ renderSql <- function(sql = "", warnOnMissingParameters = TRUE, ...) {
#'
#' @param sql The SQL to be translated
#' @param targetDialect The target dialect. Currently "oracle", "postgresql", "pdw", "impala",
#' "sqlite", "netezza", "bigquery", and "redshift" are supported.
#' "sqlite", "netezza", "bigquery", "spark", and "redshift" are supported.
#' @param oracleTempSchema DEPRECATED: use \code{tempEmulationSchema} instead.
#' @param tempEmulationSchema Some database platforms like Oracle and Impala do not truly support
#' temp tables. To emulate temp tables, provide a schema with write
Expand Down Expand Up @@ -163,7 +163,7 @@ translate <- function(sql = "",
#'
#' @param sql The SQL to be translated
#' @param targetDialect The target dialect. Currently "oracle", "postgresql", "pdw", "impala",
#' "netezza", "bigquery", and "redshift" are supported
#' "netezza", "bigquery", "spark", and "redshift" are supported
#' @param oracleTempSchema A schema that can be used to create temp tables in when using Oracle or
#' Impala.
#'
Expand Down Expand Up @@ -192,7 +192,7 @@ translateSql <- function(sql = "", targetDialect, oracleTempSchema = NULL) {
#'
#' @param sql The SQL to be translated
#' @param targetDialect The target dialect. Currently "oracle", "postgresql", "pdw", "impala",
#' "sqlite", "netezza", "bigquery", and "redshift" are supported.
#' "sqlite", "netezza", "bigquery", "spark", and "redshift" are supported.
#' @param oracleTempSchema DEPRECATED: use \code{tempEmulationSchema} instead.
#' @param tempEmulationSchema Some database platforms like Oracle and Impala do not truly support
#' temp tables. To emulate temp tables, provide a schema with write
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Features
- Supports a simple markup syntax for making SQL parameterized, and renders parameterized SQL (containing the markup syntax) to executable SQL
- The syntax supports defining default parameter values
- The syntax supports if-then-else structures
- Has functions for translating SQL from one dialect (Microsoft SQL Server) to other dialects (Oracle, PostgreSQL, Amazon RedShift, Impala, IBM Netezza, Google BigQuery, Microsoft PDW, and SQLite)
- Has functions for translating SQL from one dialect (Microsoft SQL Server) to other dialects (Oracle, PostgreSQL, Amazon RedShift, Impala, IBM Netezza, Google BigQuery, Microsoft PDW, Apache Spark, and SQLite)
- Can be used as R package, Java library, or as stand-alone executable through a command-line interface

Examples
Expand Down
36 changes: 18 additions & 18 deletions SqlRender.Rproj
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
Version: 1.0
RestoreWorkspace: No
SaveWorkspace: No
AlwaysSaveHistory: No
EnableCodeIndexing: Yes
UseSpacesForTab: Yes
NumSpacesForTab: 2
Encoding: UTF-8
RnwWeave: knitr
LaTeX: pdfLaTeX
BuildType: Package
PackageInstallArgs: --with-keep.source
PackageCheckArgs: --as-cran
PackageRoxygenize: rd,collate,namespace
Version: 1.0

RestoreWorkspace: No
SaveWorkspace: No
AlwaysSaveHistory: No

EnableCodeIndexing: Yes
UseSpacesForTab: Yes
NumSpacesForTab: 2
Encoding: UTF-8

RnwWeave: knitr
LaTeX: pdfLaTeX

BuildType: Package
PackageInstallArgs: --with-keep.source
PackageCheckArgs: --as-cran
PackageRoxygenize: rd,collate,namespace
6 changes: 3 additions & 3 deletions docs/404.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 332598a

Please sign in to comment.