@param array         $columns
@param callable|null $columnCallable

@return string
180153
private function prepareColumns(array $columns, callable $columnCallable = null): string
    {
        foreach ($columns as &$column) {
            if (is_array($column)) {
                $column = $this->prepareColumns($column, $columnCallable);
            } else {
                $column = $this->prepareColumn($column, $columnCallable);
            }
        }
        unset($column);

        return '(' . implode(', ', $columns) . ')';
    }
907821
public function get($columns = ['*'])
    {
        $original = $this->columns;

        if (is_null($original)) {
            $this->columns = $columns;
        }

        $results = $this->runSelect();

        $this->columns = $original;

        return $results;
    }
787804
public function setColumns(array $columns)
    {
        foreach ($columns as $id => $params) {
            if (!is_string($id) || strlen($id) < 1)
                throw new \Exception("Column ID should be a non-empty string");
            if (!isset($params['title']))
                throw new \Exception("No 'title' param for ID $id");
            if (!isset($params['type']))
                throw new \Exception("No 'type' param for ID $id");
            if (!in_array($params['type'], self::getAvailableTypes()))
                throw new \Exception("Unknown type '" . $params['type'] . "' for ID $id");
            if (!isset($params['filters']))
                throw new \Exception("No 'filters' param for ID $id");
            if (!isset($params['sortable']))
                throw new \Exception("No 'sortable' param for ID $id");
            if (!isset($params['visible']))
                throw new \Exception("No 'visible' param for ID $id");

            foreach ($params['filters'] as $filter) {
                if (!in_array($filter, self::getAvailableFilters()))
                    throw new \Exception("Unknown filter: $filter");
            }
        }

        $this->columns = $columns;
        return $this;
    }
1349818
public function get(array $columns = ['*']): ResultInterface
    {
        if (empty($columns)) {
            $columns = ['*'];
        }

        $isAllColumns = count($columns) == 1 && isset($columns[0]) && $columns[0] == '*';
        if (!empty($this->className) && $isAllColumns) {
            $columns = $this->getAllFields();
        }

        foreach ($columns as $column => $alias) {
            if (\is_int($column)) {
                $this->select[$alias] = null;
                continue;
            }
            $this->select[$column] = $alias;
        }

        $this->addGetDecorator();

        return $this->execute();
    }
1159405
protected function prepareQueryBuilder($columns = ['*'])
    {
        $builder = $this->query->applyScopes();

        return $builder->addSelect(
            $this->shouldSelect($builder->getQuery()->columns ? [] : $columns)
        );
    }
512102
private function _prepareColumns(array $columnsArray)
	{
		if(count($columnsArray) === 0)
		{
			throw new \Exception('"column"-method of the statement have to invoked before!');
		}
		$columns = ' ';
		foreach($columnsArray as $column)
		{
			$columns .= $column->getExpression() . ', ';
		}
		$columns       = substr($columns, 0, strlen($columns) - 2);
		$this->columns = $columns . ' ';
	}
857884
final public static function getTypedColumns($columns)
    {
        static::checkUnknownColumn($columns);

        $result = Utils::arrayWhitelist(
            array_combine(self::getColumns(), static::COLUMNS),
            (array) $columns
        );

        return (is_string($columns))
            ? array_values($result)[0]
            : $result;
    }
489023
public function selectConcat(array $columns, string $delimiter = '', ?string $alias = null)
    {
        $instance = $this->selectQueryInstance();

        $instance->selectQuery()->columnConcat($columns, $delimiter, $alias);

        return $instance;
    }
581849
public function findCallback(Closure $callback, $columns = ['*'])
    {
        /** @var EloquentBuilder $result */
        $result = $callback( $this->query() );

        $this->checkValidCustomCallback($result);

        return $result->first($columns);
    }
1353032
public function firstOrFail($columns = ['*'])
    {
        if (!is_null($entity = $this->first($columns))) {
            return $entity;
        }

        throw (new EntityNotFoundException())->setEntity(get_class($this->entityMap));
    }
1312716
protected function getSelectColumns(array $columns = ['*'])
    {
        if ($columns == ['*']) {
            $columns = [$this->relatedMap->getTable().'.*'];
        }

        return array_merge($columns, [$this->parentMap->getTable().'.'.$this->firstKey]);
    }
1218697
protected function formatColumns($columns) : string {
    if (is_string($columns)) {
      if ($columns === '*') {
        return $columns;
      }

      $columns = explode(',', $columns);

      $columns = array_map(function ($column) {
        return '`' . trim($column) . '`';
      }, $columns);

      return implode(', ', $columns);
    }

    if (is_array($columns)) {
      return '`' . implode('`, `', $columns) . '`';
    }
  }
290081
public function selectModelColumns(iterable $columns = null): self
    {
        if ($columns !== null) {
            $quotedColumns = [];
            foreach ($columns as $column) {
                $quotedColumns[] = $this->quoteDoubleIdentifier($this->getAlias(), $column);
            }
        } else {
            $quotedColumns = $this->getModelColumns();
        }

        $this->select($quotedColumns);

        return $this;
    }
654499
protected function sanitizeColumns(array $columns)
    {
        $callback = $this->getCallback();
        if ($callback) {
            foreach ($columns as $key => $value) {
                $columns[$key] = $callback($value);
            }
        }

        if (!$this->enclosure) {
            return $columns;
        }

        foreach ($columns as $key => $value) {
            if (false !== strpos($value, $this->delimiter)
                || false !== strpos($value, $this->escape)
                || false !== strpos($value, $this->enclosure)
                || false !== strpos($value, $this->newline)
            ) {
                if ($this->escape != $this->enclosure) {
                    $value = str_replace($this->escape, $this->escape . $this->escape, $value);
                }
                $value = str_replace($this->enclosure, $this->escape . $this->enclosure, $value);
                $value = $this->enclosure . $value . $this->enclosure;

                $columns[$key] = $value;
            }
        }

        return $columns;
    }
36823
public function select($columns = [])
    {
        $expr = new ColumnExpression($this->getSQLStatement());

        if ($columns instanceof Closure) {
            $columns($expr);
        } else {
            if (!is_array($columns)) {
                $columns = [$columns];
            }
            $expr->columns($columns);
        }
    }
384316
public function get($columns = array('*'))
    {
        $results = parent::get($columns);

        switch($this->returnType) {
            case Builder::RETURN_TYPE_DATAMAPPER:
                return $results->toDatamapperObject();
            case Builder::RETURN_TYPE_ELOQUENT:
                return $results;
        }
    }
353432
private function transformColumns($columns)
    {
        return array_map(function ($column) {
            return [
                'Field' => $column->COLUMN_NAME,
                'Type' => $column->DATA_TYPE,
                'Null' => $column->IS_NULLABLE,
                'Key' => $column->ORDINAL_POSITION,
                'Default' => $column->COLUMN_DEFAULT,
                'Char max len' => $column->CHARACTER_MAXIMUM_LENGTH
            ];
        }, $columns);
    }