/** * Build a data source from a table. * * @param table A fact table or fact table view * * @return A table datasource for a fact table or a union data source for a fact table view */ private DataSource buildTableDataSource(ConstrainedTable table) { if (table.getDataSourceNames().size() == 1) { return new TableDataSource(table); } else { return new UnionDataSource(table); } }
TopNQuery topNQuery = (TopNQuery) innerQuery; GroupByQuery transformed = new GroupByQuery( new UnionDataSource(topNQuery.getDataSource().getPhysicalTable()), topNQuery.getGranularity(), topNQuery.getDimensions(),