簡體   English   中英

將R與Cassandra連接

[英]connect R with Cassandra

我正在嘗試使用以下方式將R與Cassandra連接起來:

connect.handle <- RC.connect(host="host", port="port")

我有一個連接,當我測試它時,我看到一個連接:

RC.describe.keyspace(connect.handle, 'keyspace')

我看到我必須連接正常。 但是當我嘗試將Cassandra中的數據獲取到R中的數據框中時,出現錯誤,我嘗試了:

RC.read.table(connect.handle, 'table name', convert = TRUE, na.strings 
= "NA", as.is = FALSE, dec = ".")

我收到此錯誤:

Error in RC.get.range.slices(conn, c.family, fixed = TRUE) : 
Cassandra exception: No keyspace has been specified. USE a keyspace, or 
explicitly specify keyspace.tablename

如果我把鍵鋪放在像“ keyspace.tablename”這樣的表名之前,它既不會起作用。

有人可以幫助我將Cassandra中的數據導入R嗎?

謝謝,

Eelco

您可以嘗試以下方法:

RC.use(connect.handle,'your keyspace')
RC.read.table(connect.handle,"your table name")

從卡珊德拉那里讀桌子對我來說很有效。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM