Skip to content

Instantly share code, notes, and snippets.

@PMeinshausen
Created September 18, 2014 11:58
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save PMeinshausen/24e5a689047d60973370 to your computer and use it in GitHub Desktop.
--Syntax (ApproxPercentileMap version 1.1;
--ApproxPercentileReduce version 1.0)
--The synopsis below shows the syntax for invoking the approximate percentile function for
--a column of data, grouping the data by a different set of columns:
SELECT * FROM ApproxPercentileReduce(
ON(
SELECT * FROM ApproxPercentileMap(
ON {table_name | view_name | (query)}
TARGET_COLUMN('column_name')
ERROR(tolerance_value)
[GROUP_COLUMNS('column_name' [, ...])]
)
)
PARTITION BY expression [, ...]
PERCENTILE(percentile [, ...])
[GROUP_COLUMNS('column_name' [, ...])]
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment