GroupBy Quarter granularity

54 views
Skip to first unread message

Bala Murugan

unread,
Jan 30, 2018, 7:42:15 PM1/30/18
to Druid User
Hi

i would like you group the data by quarter. below is the code i've written and i'm getting error

{
"type": "extraction",
"dimension": "__time",
"outputName": "Year",
"extractionFn": {
"format": "Y QQ",
"locale": "en-US",
"timeZone": "Etc/UTC",
"granularity": "Quarter",
"type": "timeFormat"
}
}


Error

"500 - {\"error\":\"Unknown exception\",\"errorMessage\":\"Instantiation of [simple type, class io.druid.query.extraction.TimeFormatExtractionFn] value failed: Illegal pattern component: QQ (through reference chain: java.util.ArrayList[3])\",\"errorClass\":\"com.fasterxml.jackson.databind.JsonMappingException\",\"host\":null}"


Thanks in advance

Nishant Bangarwa

unread,
Jan 31, 2018, 11:58:05 AM1/31/18
to druid...@googlegroups.com
The formatter used by time format extraction function does not specifying quarter. 

If you change format to have "MM" (month) instead of "QQ" It will still truncate the timestamp based on quarter granularity just the results will have starting month of quarter instead of quarter number. 


--
You received this message because you are subscribed to the Google Groups "Druid User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to druid-user+...@googlegroups.com.
To post to this group, send email to druid...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/druid-user/e19dae8f-bb80-4bfc-a55b-333fc94bb9bb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages