private void addColumn(final Map<String, Sort> sortMap,
                               final Map<String, Integer> groupMap,
                               final Map<String, IncludeExcludeFilter> filterMap,
                               final Query.Builder queryBuilder,
                               final Map<String, AtomicInteger> columnCount,
                               final List<Column> columns,
                               final AbstractToken token,
                               final AbstractToken fieldToken,
                               final String columnName,
                               final Expression fieldExpression) {

            if (fieldToken != null) {
                if (columnName.equals("*") ||
                    (TokenType.PARAM.equals(fieldToken.getTokenType()) && columnName.contains("*"))) {
                    expandStarredField(
                            sortMap,
                            groupMap,
                            filterMap,
                            queryBuilder,
                            columnCount,
                            columns,
                            fieldToken.getUnescapedText());

                } else {
                    final String columnId = createColumnId(columnCount, columnName);
                    columns.add(createColumn(
                            fieldToken,
                            columnId,
                            fieldToken.getUnescapedText(),
                            columnName,
                            true,
                            false,
                            sortMap,
                            groupMap,
                            filterMap));
                }

            } else if (fieldExpression != null) {
                final String columnId = createColumnId(columnCount, columnName);
                columns.add(createColumn(
                        columnId,
                        fieldExpression,
                        columnName,
                        sortMap,
                        groupMap,
                        filterMap));
            } else {
                throw new TokenException(token, "Syntax exception, expected field name");
            }
        }
@param isLenient Ignores any additional child tokens found. This is to support getting just
                 the data source from a partially written query, which is likely to not be
                 a valid query. For example, you may type
                 <pre>{@code from View sel}</pre> and at this point do code completion on 'sel'
                 so if this method is called it will treat 'sel as an extra child.
stroom-query/stroom-query-common/src/main/java/stroom/query/language/SearchRequestFactory.java