granularity: Creates a Druid query granularity object

Description Usage Arguments Details Value Examples

Description

Specifies a Druid query granularity using a simple string, a numerical duration or an ISO period

Usage

1
2
granularity(str = NA, period = NA, duration = NA, origin = NA,
  timeZone = NA)

Arguments

str

a string or number representing a granularity (e.g. "day", "hour", "minute", "all", "none", 3600, "P1M", "PT1H")

period

granularity specified as an ISO period

duration

granularity specified as a duration in seconds

origin

timestamp to start computing intervals from

timeZone

optional time zone to define period granularities specified as a IANA time zone string, e.g. "America/Los_Angeles"

Details

Granularities can be specified in several ways:

- as a simple string: "day", "hour", "minute", "all", "none"

- as a number, representing the number of seconds in each period

- as an ISO period, such as "P1M", "P1W", PT1H", etc.

Value

a Druid granularity object

Examples

1
2
3
4
5
granularity("day")

granularity("PT6H", timeZone="America/Los_Angeles")

granularity(3600 * 2, origin=ymd_hms("2013-01-01T01:00:00"))

druid-io/RDruid documentation built on May 15, 2019, 2:54 p.m.