Oracle R Enterprise 1.4: ore.make.names does not work for Oracle DB connections

Christos - Iraklis Tsatsoulis Oracle R Leave a Comment

I have reported in the past about some unexpected behavior issues of Oracle R Enterprise 1.4 ore.make.names function; nevertheless, back then I had only tried it with Hive connections. I tried to use it today with an Oracle database connection, and it doesn’t seem to work. Here is a reproducible example in Oracle Big Data Lite VM 4.2.1, using the provided database schema moviedemo and the example from the function’s documentation:

> library(ORE)
> ore.connect(user="moviedemo", sid="orcl", host="localhost", password="welcome1", port=1521, all=FALSE)
> xnames <- c("col1", "Col.2", "COL_3", "col 4", "col1", "L_A_S_T C.O.L.U.M.N abcdefghijklmnopqrstuvwxyz") > xnames
[1] "col1"                                           "Col.2"                                         
[3] "COL_3"                                          "col 4"                                         
[5] "col1"                                           "L_A_S_T C.O.L.U.M.N abcdefghijklmnopqrstuvwxyz"
> ore.make.names(xnames)
[1] "col1"                           "Col.2"                          "COL_3"                         
[4] "col 4"                          "col1.1"                         "L_A_S_TC.O.L.U.M.Nabcdfghjklmn"
>

The only effect of the function in this example seems to be trimming the white spaces and the excess characters in the last long element (but not in "col 4", which remains as-is).

We can easily confirm that, for Hive connections, the function works as expected; but even in this case, disconnecting from Hive and connecting again to an Oracle schema brings back the erratic behavior:

> ore.connect(type="HIVE")
> ore.make.names(xnames)
[1] "col1"                                           "col_2"                                         
[3] "col_3"                                          "col_4"                                         
[5] "col1_1"                                         "l_a_s_t_c_o_l_u_m_n_abcdefghijklmnopqrstuvwxyz"
> ore.disconnect()
> ore.connect(user="moviedemo", sid="orcl", host="localhost", password="welcome1", port=1521, all=FALSE)
> ore.make.names(xnames)
[1] "col1"                           "Col.2"                          "COL_3"                         
[4] "col 4"                          "col1.1"                         "L_A_S_TC.O.L.U.M.Nabcdfghjklmn"
>

I know that Oracle R Enterprise 1.4.1 is not yet certified on Oracle Database 12.1.0.2, which is the VM database version; nevertheless, I have also tried the above locally with an Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 (64 bit), with identical results (not shown).

> sessionInfo()  # runs in Oracle BD Lite VM 4.2.1
Oracle Distribution of R version 3.1.1  (--)
Platform: x86_64-unknown-linux-gnu (64-bit)

locale:
[1] C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] ROracle_1.1-12    DBI_0.2-7         ORE_1.4.1         ORExml_1.4.1      OREpredict_1.4.1  OREdm_1.4.1      
 [7] lattice_0.20-29   OREmodels_1.4.1   OREeda_1.4.1      OREgraphics_1.4.1 OREstats_1.4.1    MASS_7.3-33      
[13] OREembed_1.4.1    OREbase_1.4.1    

loaded via a namespace (and not attached):
[1] Matrix_1.1-4    OREcommon_1.4.1 arules_1.1-3    grid_3.1.1      png_0.1-7       tools_3.1.1  
Christos - Iraklis Tsatsoulis

Christos - Iraklis Tsatsoulis

Christos - Iraklis is one of our resident Data Scientists. He holds advanced graduate degrees in applied mathematics, engineering, and computing. He has been awarded both Chartered Engineer and Chartered Manager status in the UK, as well as Master status in Kaggle.com due to "consistent and stellar results" in predictive analytics contests.
Christos - Iraklis Tsatsoulis

Latest posts by Christos - Iraklis Tsatsoulis (see all)

Leave a Reply

avatar
  Subscribe  
Notify of