Undocumented behavior of ore.make.names() function in Oracle R Enterprise

(This article was first published on R – Nodalpoint, and kindly contributed to R-bloggers)

While working with some data in Hive recently using the Oracle R Connectors for Hadoop (ORCH), I tried to use the ore.make.names function (of package OREbase ). The function creates valid column names for ore.frame objects. Here is a reproducible example, copied straight from the function documentation:

> library(ORCH)
> xnames <- c("col1", "Col.2", "COL_3", "col 4", "col1",
"L_A_S_T C.O.L.U.M.N abcdefghijklmnopqrstuvwxyz")
> ore.make.names(xnames)
Error in ore.make.names(xnames) : attempt to apply non-function

Experimenting a little, I discovered that ore.make.names becomes functional after executing ore.connect. Indeed, using Hive:

> ore.connect(type="HIVE")
> ore.make.names(xnames)
[1] "col1"
[2] "col_2"
[3] "col_3"
[4] "col_4"
[5] "col1_1"
[6] "l_a_s_t_c_o_l_u_m_n_abcdefghijklmnopqrstuvwxyz"

Such a behavior (i.e. the requirement for a prior call to ore.connect ) is not mentioned in the function documentation.

Furthermore, if we disconnect from the database and try to run ore.make.names, we get again an error message, albeit a different one this time:

> ore.disconnect()
> ore.make.names(xnames)
Error: '$' is not implemented yet'.ore.QueryEnv' is not implemented yet'makeDBnames' is not implemented yet

I posted a question in the Oracle R Technologies forum, where it was confirmed that the incorrect error messages have been logged as a bug, and that in future releases an appropriate error message will be returned, indicating that a connection via ore.connect is required.

> sessionInfo()  # runs in Oracle BD Lite VM 4.0.1
Oracle Distribution of R version 3.1.1 (--)
Platform: x86_64-unknown-linux-gnu (64-bit)
other attached packages:
[1] ORCH_2.4.1 ORCHstats_2.4.1 ORCHcore_2.4.1 OREstats_1.4.1
[5] MASS_7.3-33 OREbase_1.4.1

The post Undocumented behavior of ore.make.names() function in Oracle R Enterprise appeared first on Nodalpoint.

To leave a comment for the author, please follow the link and comment on their blog: R – Nodalpoint.

R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...

If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.

Search R-bloggers


Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)