Skip to content
This repository has been archived by the owner on May 22, 2024. It is now read-only.

Commit

Permalink
Bug fix: error for crossprod if the user does not have permission to …
Browse files Browse the repository at this point in the history
…/tmp

Avoid using /tmp
  • Loading branch information
Qian, Hai committed Apr 14, 2014
1 parent e27d7f2 commit 7ab9893
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Package: PivotalR
Type: Package
Title: R front-end to PostgreSQL and Pivotal (Greenplum) database,
wrapper for MADlib
Version: 0.1.15.23
Version: 0.1.15.24
Date: 2014-03-10
Author: Predictive Analytics Team at Pivotal Inc. <user@madlib.net>,
with contributions from Data Scientist Team at Pivotal Inc.
Expand Down
12 changes: 7 additions & 5 deletions R/generic.bagging.R
Original file line number Diff line number Diff line change
Expand Up @@ -141,14 +141,16 @@ predict.bagging.model <- function (object, newdata, combine = "mean",
sql.file <- paste(.localVars$pkg.path, "/sql/", funcname,
".sql_in", sep = "")
use.name <- .unique.string()
tmp.file <- paste("/tmp/", use.name, ".sql_in", sep = "")
## tmp.file <- paste("/home/gpadmin/Downloads/tests/", use.name, ".sql_in", sep = "")
old.name <- paste("pg_temp.", funcname, sep = "")
new.name <- paste("pg_temp.", use.name, sep = "")
system(paste("sed -e \"s/", old.name, "/", new.name, "/g\" ", sql.file,
" > ", tmp.file, sep = ""))
cmd <- paste(scan(tmp.file, what = 'a', sep = "\n", quiet = TRUE), collapse = "\n")
## system(paste("sed -e \"s/", old.name, "/", new.name, "/g\" ", sql.file,
## " > ", tmp.file, sep = ""))
## cmd <- paste(scan(tmp.file, what = 'a', sep = "\n", quiet = TRUE), collapse = "\n")
cmd <- paste(scan(sql.file, what = 'a', sep = "\n", quiet = TRUE), collapse = "\n")
cmd <- gsub(old.name, new.name, cmd)
res <- .db.getQuery(cmd, conn.id)
system(paste("rm -f ", tmp.file, sep = ""))
## system(paste("rm -f ", tmp.file, sep = ""))

fn.schema <- .db.getQuery(paste("SELECT specific_schema from information_schema.routines where routine_name = '",
use.name, "'", sep = ""), conn.id)
Expand Down

0 comments on commit 7ab9893

Please sign in to comment.