Skip to content

Instantly share code, notes, and snippets.

@saicitus
Created March 29, 2018 21:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save saicitus/8b8c3d825dd88bb8e2b0b85cf8e294fb to your computer and use it in GitHub Desktop.
Save saicitus/8b8c3d825dd88bb8e2b0b85cf8e294fb to your computer and use it in GitHub Desktop.
CREATE AGGREGATE sum(jsonb)(
SFUNC = topn_union_trans,
STYPE = internal,
FINALFUNC = topn_pack
);
CREATE AGGREGATE sum(text)(
SFUNC = topn_add_trans,
STYPE = internal,
FINALFUNC = topn_pack
);
SELECT run_command_on_workers($cmd$CREATE AGGREGATE sum(jsonb)(
SFUNC = topn_union_trans,
STYPE = internal,
FINALFUNC = topn_pack
);$cmd$);
SELECT run_command_on_workers($cmd$CREATE AGGREGATE sum(text)(
SFUNC = topn_add_trans,
STYPE = internal,
FINALFUNC = topn_pack
);$cmd$);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment