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

Christos - Iraklis TsatsoulisOracle R 2 Comments

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
Christos - Iraklis Tsatsoulis
Latest posts by Christos - Iraklis Tsatsoulis (see all)
Subscribe
Notify of
2 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
trackback
December 14, 2015 16:44

[…] have reported in the past about some unexpected behavior issues of Oracle R Enterprise 1.4 ore.make.names function; […]

Thanasis Paraskevas
Thanasis Paraskevas
August 4, 2016 15:40

Very helpful notification, especially for someone who just forgot to add the specific line to connect with Hive.