KxSystems / rkdb

R client for kdb+
https://code.kx.com/q/interfaces
Apache License 2.0
41 stars 30 forks source link

basic type not supported #54

Closed statquant closed 4 years ago

statquant commented 4 years ago

Hello, it looks like basic type conversion are not supported from R -> q

R) con <- open_connection(port = 12345)
R) DF =  data.frame(x=1:2, y=1L:2L, z = c("11", "11"), d = Sys.Date() + 1:2)
R) execute(con, "{[x] `data set x}", DF)

q) data
x y z    d                
--------------------------
1 1 "11" (,`class)!,"Date"
2 2 "11" 18242 18243f     
cmccarthy1 commented 4 years ago

Hi @statquant,

This type conversion was added in https://github.com/KxSystems/rkdb/pull/52. If you update your rkdb installation to the version on the current master branch this conversion should be handled. As seen below

R
> devtools::install_github('kxsystems/rkdb', quiet=TRUE,INSTALL_opts=c("--no-multiarch"))
> library(rkdb)
> con <- open_connection(port = 12345)
> DF =  data.frame(x=1:2, y=1L:2L, z = c("11", "11"), d = Sys.Date() + 1:2)
> execute(con, "{[x] `data set x}", DF)
[1] "data"

q
q)data
x y z  d         
-----------------
1 1 11 2019.12.12
2 2 11 2019.12.13

I'm closing this issue for now, please feel free to reopen if there are any issues with the above

statquant commented 4 years ago

sorry about this it is working fine