WordPress at a glance
function is not described

Automattic\WooCommerce\Admin\API\Reports

Segmenter::prepare_selections() protected WC 1.0

Filters definitions for SELECT clauses based on query_args and joins them into one string usable in SELECT clause.

{} It's a method of the class: Segmenter{}

No Hooks.

Return

String. to be used in SELECT clause statements.

Usage

// protected - for code of main (parent) or child class
$result = $this->prepare_selections( $columns_mapping );
$columns_mapping(array) (required)
Column name -> SQL statememt mapping.

Code of Segmenter::prepare_selections() WC 5.3.0

<?php
protected function prepare_selections( $columns_mapping ) {
	if ( isset( $this->query_args['fields'] ) && is_array( $this->query_args['fields'] ) ) {
		$keep = array();
		foreach ( $this->query_args['fields'] as $field ) {
			if ( isset( $columns_mapping[ $field ] ) ) {
				$keep[ $field ] = $columns_mapping[ $field ];
			}
		}
		$selections = implode( ', ', $keep );
	} else {
		$selections = implode( ', ', $columns_mapping );
	}

	if ( $selections ) {
		$selections = ',' . $selections;
	}

	return $selections;
}