error converting result query result to df
dynamix opened this issue · comments
Martin Karlsch commented
I get the following error : "Error in x$timestamp : $ operator is invalid for atomic vectors" given the following query.
start = ymd(20150113)
end = ymd(20150120)
r = druid.query.groupBy(
url = druid.url("master1.dw.xyz.com", port=8080),
dataSource = "mysource",
intervals = interval(start, end),
aggregations = list(
sum(metric("mycounter"))
),
granularity = granularity("all"),
dimensions = list('xyz')
)
If I run the query with rawData=T, it works and the set looks like this.
version timestamp event.mycounter event.xyz
1 v1 2015-01-13T00:00:00.000Z 576 <NA>
2 v1 2015-01-13T00:00:00.000Z 1167 1
3 v1 2015-01-13T00:00:00.000Z 5 10
4 v1 2015-01-13T00:00:00.000Z 102 10080
5 v1 2015-01-13T00:00:00.000Z 24 1020
6 v1 2015-01-13T00:00:00.000Z 25 1080
7 v1 2015-01-13T00:00:00.000Z 2 11
8 v1 2015-01-13T00:00:00.000Z 29 1140
9 v1 2015-01-13T00:00:00.000Z 79 11520
10 v1 2015-01-13T00:00:00.000Z 6 12
11 v1 2015-01-13T00:00:00.000Z 55 120
12 v1 2015-01-13T00:00:00.000Z 25 1200
13 v1 2015-01-13T00:00:00.000Z 35 1260
14 v1 2015-01-13T00:00:00.000Z 65 12960
I looked into query.R / groupBytodf where it fails in ts <- laply(result, function(x) { x$timestamp }
whereas class(x$timestamp) is "character".
Any ideas what is wrong here?
Ciao,
Martin