Skip to content

Commit

Permalink
Implement alias loadDF() as a new function.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sun Rui committed May 13, 2015
1 parent 3a30c10 commit 5c5cf5e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions R/pkg/R/SQLContext.R
Original file line number Diff line number Diff line change
Expand Up @@ -446,15 +446,14 @@ dropTempTable <- function(sqlCtx, tableName) {
#' @param source the name of external data source
#' @return DataFrame
#' @export
#' @aliases loadDF
#' @examples
#'\dontrun{
#' sc <- sparkR.init()
#' sqlCtx <- sparkRSQL.init(sc)
#' df <- read.df(sqlCtx, "path/to/file.json", source = "json")
#' }

read.df <- loadDF <- function(sqlCtx, path = NULL, source = NULL, ...) {
read.df <- function(sqlCtx, path = NULL, source = NULL, ...) {
options <- varargsToEnv(...)
if (!is.null(path)) {
options[['path']] <- path
Expand All @@ -463,6 +462,13 @@ read.df <- loadDF <- function(sqlCtx, path = NULL, source = NULL, ...) {
dataFrame(sdf)
}

#' @aliases loadDF
#' @export

loadDF <- function(sqlCtx, path = NULL, source = NULL, ...) {
read.df(sqlCtx, path, source, ...)
}

#' Create an external table
#'
#' Creates an external table based on the dataset in a data source,
Expand Down

0 comments on commit 5c5cf5e

Please sign in to comment.