Package com.google.visualization.datasource.query

Examples of com.google.visualization.datasource.query.QuerySelection.addColumn()


      List<AbstractColumn> originalSelectedColumns =
          query.getSelection().getColumns();
      for (int i = 0; i < originalSelectedColumns.size(); i++) {
        AbstractColumn column = originalSelectedColumns.get(i);
        if (query.getGroup().getColumns().contains(column)) {
          completionSelection.addColumn(column);
        } else { // Must be an aggregation column if doesn't appear in the grouping.
          // The id here is the id generated by the data source for the column containing
          // the aggregated data, e.g., max-B.
          String id = column.getId();
          // MIN is chosen arbitrarily, because there will be exactly one.
View Full Code Here


        } else { // Must be an aggregation column if doesn't appear in the grouping.
          // The id here is the id generated by the data source for the column containing
          // the aggregated data, e.g., max-B.
          String id = column.getId();
          // MIN is chosen arbitrarily, because there will be exactly one.
          completionSelection.addColumn(
              new AggregationColumn(new SimpleColumn(id), AggregationType.MIN));
        }
      }

      completionQuery.setSelection(completionSelection);
View Full Code Here

    Query dataSourceQuery = new Query();
    Query completionQuery = new Query();
    if (query.getSelection() != null) {
      QuerySelection selection = new QuerySelection();
      for (String simpleColumnId : query.getAllColumnIds()) {
        selection.addColumn(new SimpleColumn(simpleColumnId));
      }
      // Column selection can be empty. For example, for query "SELECT 1".
      dataSourceQuery.setSelection(selection);
    }
View Full Code Here

   */
  @Override
  public void setUp() throws Exception {
    q = new Query();
    QuerySelection selection = new QuerySelection();
    selection.addColumn(new SimpleColumn("A"));
    selection.addColumn(new AggregationColumn(new SimpleColumn("B"), AggregationType.MAX));
    q.setSelection(selection);
    QuerySort sort = new QuerySort();
    sort.addSort(new ColumnSort(new SimpleColumn("A"), SortOrder.DESCENDING));
    q.setSort(sort);
View Full Code Here

  @Override
  public void setUp() throws Exception {
    q = new Query();
    QuerySelection selection = new QuerySelection();
    selection.addColumn(new SimpleColumn("A"));
    selection.addColumn(new AggregationColumn(new SimpleColumn("B"), AggregationType.MAX));
    q.setSelection(selection);
    QuerySort sort = new QuerySort();
    sort.addSort(new ColumnSort(new SimpleColumn("A"), SortOrder.DESCENDING));
    q.setSort(sort);
    QueryFilter filter = new ColumnValueFilter(new SimpleColumn("A"), new TextValue("foo"),
View Full Code Here

    q.setGroup(null);
    q.setFilter(null);
    q.setPivot(null);
    // Remove aggregation column:
    QuerySelection newSel = new QuerySelection();
    newSel.addColumn(new SimpleColumn("A"));
    q.setSelection(newSel);

    QueryPair split = QuerySplitter.splitQuery(q, Capabilities.SORT_AND_PAGINATION);
    Query dataSourceQuery = split.getDataSourceQuery();
    Query completionQuery = split.getCompletionQuery();
View Full Code Here

                group.addColumn(col);
            }
            dataSourceQuery.setGroup(group);
            QuerySelection selection = new QuerySelection();
            for(AbstractColumn col : newSelectionColumns) {
                selection.addColumn(col);
            }
            dataSourceQuery.setSelection(selection);

            // Build the completion query to group by the grouping columns. Because an aggregation is
            // required, make a dummy aggregation on the original column by which the aggregation is
View Full Code Here

            List<AbstractColumn> originalSelectedColumns =
                    query.getSelection().getColumns();
            for(int i = 0; i < originalSelectedColumns.size(); i++) {
                AbstractColumn column = originalSelectedColumns.get(i);
                if(query.getGroup().getColumns().contains(column)) {
                    completionSelection.addColumn(column);
                }
                else { // Must be an aggregation column if doesn't appear in the grouping.
                    // The id here is the id generated by the data source for the column containing
                    // the aggregated data, e.g., max-B.
                    String id = column.getId();
View Full Code Here

                else { // Must be an aggregation column if doesn't appear in the grouping.
                    // The id here is the id generated by the data source for the column containing
                    // the aggregated data, e.g., max-B.
                    String id = column.getId();
                    // MIN is chosen arbitrarily, because there will be exactly one.
                    completionSelection.addColumn(
                            new AggregationColumn(new SimpleColumn(id), AggregationType.MIN));
                }
            }

            completionQuery.setSelection(completionSelection);
View Full Code Here

        Query dataSourceQuery = new Query();
        Query completionQuery = new Query();
        if(query.getSelection() != null) {
            QuerySelection selection = new QuerySelection();
            for(String simpleColumnId : query.getAllColumnIds()) {
                selection.addColumn(new SimpleColumn(simpleColumnId));
            }
            // Column selection can be empty. For example, for query "SELECT 1".
            dataSourceQuery.setSelection(selection);
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.