r - How can I access the data in a Cassandra Table using RCassandra -
i need data in column of table cassandra database. using rcassandra this. after getting data need text mining on it. please suggest me how connect cassandra, , data r script using rcassandra
my rscript :
library(rcassandra) connect.handle <- rc.connect(host="127.0.0.1", port=9160) rc.cluster.name(connect.handle) rc.use(connect.handle, 'mykeyspace') sourcetable <- rc.read.table(connect.handle, "sourcetable") print(ncol(sourcetable)) print(nrow(sourcetable)) print(sourcetable)
this print output as:
> print(ncol(sourcetable)) [1] 1 > print(nrow(sourcetable)) [1] 18 > print(sourcetable) 144 bbc news 158 ibn live 123 reuters 131 ibn live
but cassandra table contains 4 columns, here showing 1 column. need each column values separated. how individual column values(eg.each feedurl) changes should make in r script?
i have used cassandra , r correct cran jar files, rcassandra easier. rcassandra direct interface cassandra without use of java. connect cassandra use rc.connect return connection handle this.
rc.connect(host = <xxx>, port = <xxx>) rc.login(conn, username = "bar", password = "foo")
you can use rc.get
command retrieve data or rc.readtable
command read table data.
but, first should read this
Comments
Post a Comment