Skip to main content

mergecolumn

mergecolumn column1 ... columnN

Merges all values in the provided column(s) from ALL rows, split by a delimiter.

arguments:​

column​

The column to merge. (type: string)

examples:​

Query​

seed '[
{"mergeme": "hi","mergeme2": "bye"},
{"mergeme": "hello","mergeme2": "goodbye"},
{"mergeme": "hey","mergeme2": "see ya"}
]'
|| mergecolumn mergeme mergeme2

Results prior to mergecolumn stage:​

mergememergeme2
hibye
hellogoodbye
heysee ya

Results after mergecolumn stage:​

mergeme.0mergeme.1mergeme.2mergeme2.0mergeme2.1mergeme2.2
hihelloheybyegoodbyesee ya

Query​

seed '[
{"mergeme": "hi","mergeme2": "bye"},
{"mergeme": "hello","mergeme2": "goodbye"},
{"mergeme": "hey","mergeme2": "see ya"}
]'
|| mergecolumn mergeme mergeme2 --asArray false

Results prior to mergecolumn stage:​

mergememergeme2
hibye
hellogoodbye
heysee ya

Results after mergecolumn stage:​

mergememergeme2
hi,hello,heybye,goodbye,see ya

flags:​

--appendStage​

Used to append the results from a previous stage to the current stage. (provide a label, stage index, or boolean true to append the previous results)

--asArray​

When true, the merged column will be an array instead of a string.

--cache​

A boolean value of true/false that determines whether or not to use the cache. Generally most commands will default to true.

--checkpoint​

Format: "{CHECKPOINT NAME}:{COLUMN}" Used to store the value of the provided column (in the first row of results) in the provided name for use as a checkpoint in scheduled queries or other stages. Not encrypted. Can be accessed using $CHECKPOINTS.{CHECKPOINT NAME}$

--delimiter​

The delimiter for the merged column row values.

--filter​

A filter to run on the command results before completing the command. If not provided, no filter is run on the results.

--guid​

Adds a populated random guid column.

--ignoreEmpty​

When true, empty values will not be included in the merged column.

--labelStage​

Used to label a stage with a user provided label.

--maxRows​

Maximum number of rows to include in a merge (will create multiple rows containing the merged column in chunks if there are more rows than the provided maxRows).

--randomizeHash​

Randomizes the stage hash, even if args and flags are the same.

--stats​

Controls if a stats calculation is run on a stage after it completes.

--table​

A comma separated list of columns to include in the command results. If not provided, all columns will be included.

--type​

Each command has a default type, either "mapping" or "reducing". Some commands can operate as either, when "reducing" they will operate on all rows at once, when "mapping", they will operate on one row at a time.

--variable​

Format: "{VARIABLE NAME}:{COLUMN}" Used to store the value of the provided column (in the first row of results) in the provided name for use as a variable in other stages. Can be accessed using $VARIABLES.{VARIABLE NAME}$. Stored as an encrypted secret. Not stored across queries.

support​

AMI_ENTERPRISE AMI_FREE AMI_PRO BINARY_ENTERPRISE BINARY_FREE BINARY_PRO DESKTOP_ENTERPRISE DESKTOP_FREE DESKTOP_PRO DOCKER_ENTERPRISE DOCKER_FREE DOCKER_PRO