groupInDB

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 27, 2017 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package groupInDB is the implementation of the group stage that runs in database.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BaseComputation

func BaseComputation(options *group.Options) *expr.Pipeline

BaseComputation generates operations for compute base statistics. Example results:

[
	{
		ID: {
			FIELD_NAME: "name"
			FIELD_TYPE: "string",
			STAT_TYPE: BASE_STATS,
		}
		COUNT: 5
		...
	},
	...
]

func ComputeStats

func ComputeStats(p *expr.Pipeline, groupOptions *group.Options, analysisOptions *analysis.Options)

ComputeStats generates pipeline that compute stats of values and lengths. Example results:

[
	{
		ID: {
			FIELD_NAME: "name"
			FIELD_TYPE: "string",
			STAT_TYPE: BASE_STATS,
		}
		COUNT: 5
		...
	},
	...
]

func ConvertDateToTimezone

func ConvertDateToTimezone(date interface{}, location *time.Location) interface{}

ConvertDateToTimezone converts date to desired timezone

func DateHourHistogram

func DateHourHistogram(location *time.Location) *expr.Pipeline

DateHourHistogram returns hour histogram histogram calculation pipeline.

func DateWeekdayHistogram

func DateWeekdayHistogram(location *time.Location) *expr.Pipeline

DateWeekdayHistogram returns weekday histogram calculation pipeline.

func GroupStats

func GroupStats(p *expr.Pipeline, groupOptions *group.Options)

GroupStats computes stats of values and lengths. Example results:

[
	{
		FIELD_NAME: "name"
		FIELD_TYPE: "string",
		COUNT: 5
		VALUE_HISTOGRAM: ...
		...
	},
	...
]

func GroupValues

func GroupValues(p *expr.Pipeline, options *group.Options)

GroupValues from expand stage by name and type. Example results:

	[
		{
			FIELD_NAME: "name"
			FIELD_TYPE: "string",
                     ALL_VALUES: [
				{
					VALUE: "Michael",
					LENGTH: 7,
				},
				{
					VALUE: "Mike",
					LENGTH: 4,
				},
                             ...
                     ]
		},
		...
	]

func LengthExtremesComputation

func LengthExtremesComputation(options *group.Options) *expr.Pipeline

LengthExtremesComputation adds length extremes computation to aggregation pipeline Example results:

[
	{
		ID: {
			FIELD_NAME: "name"
			FIELD_TYPE: "string",
			STAT_TYPE: LENGTH_EXTREMES,
		}
		MIN_LENGTH: 2,
		MAX_LENGTH: 5,
		AVG_LENGTH: 2.45,
		...
	},
	...
]

func LengthsHistogram

func LengthsHistogram(options *group.Options) *expr.Pipeline

LengthsHistogram adds lengths histogram calculation to aggregation pipeline.

func NewStage

func NewStage(groupOptions *group.Options) *analysis.Stage

NewStage - GroupInDB stage factory

func ValueExtremesComputation

func ValueExtremesComputation(options *group.Options) *expr.Pipeline

ValueExtremesComputation generates pipeline to compute min, max and avg value. Example results:

[
	{
		ID: {
			FIELD_NAME: "name"
			FIELD_TYPE: "string",
			STAT_TYPE: VALUE_EXTREMES,
		}
		MIN_VALUE: "abc",
		MAX_VALUE: "NKLXYZ",
		AVG_VALUE: nil,
		...
	},
	...
]

func ValueFreqComputation

func ValueFreqComputation(options *group.Options) *expr.Pipeline

ValueFreqComputation generates pipeline that compute most and least frequent values. Example results:

[
	{
		ID: {
			FIELD_NAME: "name"
			FIELD_TYPE: "string",
			STAT_TYPE: VALUE_FREQ_STATS,
		}
		COUNT_UNIQUE: 4,
		TOP_N_VALUES: ...
		BOTTOM_N_VALUES: ...
	},
	...
]

func ValuesHistogram

func ValuesHistogram(options *group.Options) *expr.Pipeline

ValuesHistogram returns lengths histogram calculation pipeline.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL