druid-io / RDruid

Druid connector for R

Home Page:http://druid-io.github.io/RDruid/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

groupBy fails for single dimensions

seanv507 opened this issue · comments

"Can not deserialize instance of java.util.ArrayList out of VALUE_STRING token\n at [Source: [B@1c968b4; line: 27, column: 20]\n"

I believe the problem is json function which calls toJSON with asIs =[False] ie default so that single column vector is converted into scalar ie "dimensions": "country" instead of dimensions: ["country"]

But I do not know whether setting asIs
json <- function(obj, ...) {
toJSON(obj, digits=22, collapse="", asIs=T,...)
} will cause other things to fail!

query.js <- json(list(intervals = as.list(toISO(intervals)),
aggregations = renameagg(aggregations),
dataSource = dataSource,
filter = filter,
having = having,
granularity = granularity,
dimensions = dimensions,
postAggregations = renameagg(postAggregations),
limitSpec = limitSpec,
queryType = "groupBy",
context = context), pretty=verbose)

dimensions should always be a list, not a character vector. I will add a check to make sure that's the case

I didnt explain. You pass in a list but tojson converts single element
lists into scalar unless you set asIs to true

The following seems to work for me, can you give me an example query that doesn't?
groupBy( [...] , dimensions = list("country") )

I was doing c("company") copying c("x","y") group by example
On 19 Sep 2013 21:31, "xvrl" notifications@github.com wrote:

The following seems to work for me, can you give me an example query that
doesn't?
groupBy( [...] , dimensions = list("country") )


Reply to this email directly or view it on GitHubhttps://github.com/metamx/RDruid/issues/3#issuecomment-24766893
.