我正在使用的Vertica数据库表有一个名为:incident.date
我连接到它正常:
install.packages("RJDBC",dep=TRUE)
library(RJDBC)
vDriver <- JDBC(driverClass="com.vertica.jdbc.Driver", classPath="C:/Vertica/vertica jar/vertica-jdbc-7.0.1-0.jar")
vertica <- dbConnect(vDriver, "jdbc:vertica://127.0.0.1:5433/dir", "name", "pass")
我可以从中提取常规查询:
myframe = dbGetQuery(vertica, "Select * from output_servers")
但是如果我想要名称中带有点的特定列,则会出现错误。
myframe = dbGetQuery(vertica, "Select product, incident, incident.date from output_servers")
Error in .verify.JDBC.result(r, "Unable to retrieve JDBC result set for ", :
Unable to retrieve JDBC result set for Select product, incident, incident.date from output_servers ([Vertica][VJDBC](4566) ERROR: Relation "incident" does not exist)
我尝试了方括号、反引号、单引号和双引号以及列名周围的反斜杠。我很确定这很简单,但我错过了什么?谢谢!
我找到了它:
myframe = dbGetQuery(vertica, "Select product, incident, "incident.date" from output_servers")
显然是Vertica在乎,而不是R。