DataCube API

This describes the data cube object and it's component parts attribute, dimension, and measure.

Data cube object

Described here are only the properties which you might want to change.

# name (string)

The name of the data cube as used internally in Pivot and used in the URLs. This should be a URL safe string. Changing this property for a given data cube will break any URLs that someone might have generated for that data cube in the past.

# clusterName (string)

The cluster that the data cube belongs to (or 'native' if this is a file based data cube)

# title (string)

The user visible name that will be used to describe this data cube in the UI. It is always safe to change this.

# description (string)

The description of the data cube shown in the homepage.

# defaultTimezone (string - timezone)

The default timezone, expressed as an Olsen timezone, that will be selected when the user first opens this cube. Default Etc/UTC.

# defaultDuration (string - duration)

The time period, expressed as an ISO 8601 duration, that will be shown when the user first opens this cube. Default P1D (1 day).

# defaultSortMeasure (string)

The name of the measure that will be used for default sorting. It is commonly set to the measure that represents the count of events. Default: the first measure.

# defaultSelectedMeasures (string[])

The names of the measures that will be selected by default. Default: first four measures.

# defaultPinnedDimensions (string[])

The names of the dimensions (in order) that will appear pinned by default on the right panel. Default: [].

Attribute object

The attributes: section of the data cube is there for you to fix that.

# name (string)

The name of the attribute (column) in Druid. This must match the Druid name.

Dimension object

In this section you can define the dimensions that users can split and filter on in the UI. The order of the dimension list in the top of the left panel is determined by the order of the dimensions definitions in this section.

# name (string)

The name of the dimension. This does not have to correspond to the attribute name (but the auto generated dimensions do). This should be a URL safe string. Changing this property will break any URLs that someone might have generated that include this dimension.

# title (string)

The title for this dimension in the UI. Can be anything and is safe to change at any time.

# url (string)

A url associated with the dimension, with optional token '%s' that is replaced by the dimension value to generate a link specific to each value.

# granularities (string[5])

For time dimensions you can define a set of exactly 5 granularities that you want to be available for bucketing.

Each granularity must be expressed as a 'floorable' ISO 8601 duration A floorable duration is any duration that is either a single period like P1D, P1W, PT1S, e.t.c. or a multiple period that divides into the larger period. For example, P3M is floorable because 3 divides 12 but P5M is not floorable.

By default granularities is set to: ['PT1M', 'PT5M', 'PT1H', 'P1D', 'P1W']

If you mainly care about smaller intervals, you might want to set it to: ['PT1S', 'PT15S', 'PT30S', 'PT1M', 'PT1H']

Alternatively, if you mainly care about large intervals, you might want to try: ['P1D', 'P1W', 'P1M', 'P3M', 'P1Y']

# bucketingStrategy ('defaultBucket' | 'defaultNoBucket')

Specify whether or not the dimension should be bucketed by default. If unspecified defaults to 'defaultBucket' for time and numeric dimensions.

# sortStrategy ('self' | someMeasureName)

Specify a specific sort strategy for this dimension in visualizations. If unspecified defaults to best sort strategy based on the visualization.

# formula (string - plywood expression)

The formula for this dimension. By default it is $name where name is the name of the dimension. You can create derived dimensions by using non-trivial formulas.

Measure object

In this section you can define the measures that users can aggregate on (apply) on in the UI. The order of the measure list in the bottom of the left panel is determined by the order of the measure definitions in this section.

# name (string)

The name of the measure. This should be a URL safe string. Changing this property will break any URLs that someone might have generated that include this measure.

# title (string)

The title for this measure in the UI. Can be anything and is safe to change at any time.

# units (string)

The units for this measure. To be shown alongside the title.

# formula (string - plywood expression)

The Plywood expression for this dimension. By default it is $main.sum($name) where name is the name of the measure.

The $main part of the measure expressions serves as a placeholder for the data segment. In Plywood every aggregate is a function that acts on a data segment.

Pivot

Advanced

Api