0
a[1]
[1] "AA"
> rhive.query("select count( uniquecarrier)  from f08 where uniquecarrier= '",a[1] ," ' ")
Error: java.sql.SQLException: Query returned non-zero code: 40000, cause: FAILED: ParseException line 1:61 cannot recognize input near '<EOF>' '<EOF>' '<EOF>' in expression specification
In addition: Warning messages:
1: In lapply(list(...), ._java_valid_object) : NAs introduced by coercion
2: In lapply(list(...), ._java_valid_object) : NAs introduced by coercion

I want to supply value vector value to rhive, but when I fire the above query it displays an error.

David Robinson
  • 77,383
  • 16
  • 167
  • 187

1 Answers1

1

You are providing the query as separate arguments to rhive.query, which doesn't work (the command needs to be the first argument). You need to paste0 them together first:

cmd <- paste0("select count( uniquecarrier)  from f08 where uniquecarrier= '", a[1] , "'")
cmd
# [1] "select count( uniquecarrier)  from f08 where uniquecarrier= 'AA'"

rhive.query(cmd)
David Robinson
  • 77,383
  • 16
  • 167
  • 187