private void expandStarredField(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 String fieldNameFilter) {
            final DocRef dataSource = queryBuilder.build().getDataSource();
            if (dataSource != null) {
                String filter = fieldNameFilter;

                // Create a regex name filter if the user has used a *.
                if (filter.equals("*")) {
                    filter = null;
                } else if (filter.contains("*")) {
                    filter = filter.replaceAll("\\*", ".*");
                    filter = filter.replaceAll("\\?", ".?");
                    filter = "/" + filter;
                }

                final FindFieldCriteria criteria = new FindFieldCriteria(
                        PageRequest.createDefault(),
                        FindFieldCriteria.DEFAULT_SORT_LIST,
                        dataSource,
                        filter,
                        null);
                final ResultPage<QueryField> resultPage = queryFieldProviderProvider.get().findFields(criteria);
                final List<QueryField> fields = resultPage.getValues();
                for (final QueryField field : fields) {
                    final String fieldName = field.getFldName();
                    final char[] chars = fieldName.toCharArray();
                    final String columnId = createColumnId(columnCount, fieldName);
                    final Token t = new Token(TokenType.STRING, chars, 0, chars.length - 1);
                    columns.add(createColumn(
                            t,
                            columnId,
                            t.getUnescapedText(),
                            fieldName,
                            true,
                            false,
                            sortMap,
                            groupMap,
                            filterMap));
                }
            }
        }
@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