Search in sources :

Example 1 with TableExportDescription

use of com.bakdata.conquery.models.query.queryplan.TableExportQueryPlan.TableExportDescription in project conquery by bakdata.

the class TableExportQuery method createQueryPlan.

@Override
public TableExportQueryPlan createQueryPlan(QueryPlanContext context) {
    List<TableExportDescription> resolvedConnectors = new ArrayList<>();
    for (CQUnfilteredTable table : tables) {
        Connector connector = table.getTable();
        // if no dateColumn is provided, we use the default instead which is always the first one.
        // Set to null if none-available in the connector.
        final Column validityDateColumn = findValidityDateColumn(connector, table.getDateColumn());
        final TableExportDescription exportDescription = new TableExportDescription(connector.getTable(), validityDateColumn);
        resolvedConnectors.add(exportDescription);
    }
    return new TableExportQueryPlan(query.createQueryPlan(context), CDateRange.of(dateRange), resolvedConnectors, positions);
}
Also used : Connector(com.bakdata.conquery.models.datasets.concepts.Connector) CQUnfilteredTable(com.bakdata.conquery.apiv1.query.concept.filter.CQUnfilteredTable) Column(com.bakdata.conquery.models.datasets.Column) TableExportQueryPlan(com.bakdata.conquery.models.query.queryplan.TableExportQueryPlan) TableExportDescription(com.bakdata.conquery.models.query.queryplan.TableExportQueryPlan.TableExportDescription) ArrayList(java.util.ArrayList)

Aggregations

CQUnfilteredTable (com.bakdata.conquery.apiv1.query.concept.filter.CQUnfilteredTable)1 Column (com.bakdata.conquery.models.datasets.Column)1 Connector (com.bakdata.conquery.models.datasets.concepts.Connector)1 TableExportQueryPlan (com.bakdata.conquery.models.query.queryplan.TableExportQueryPlan)1 TableExportDescription (com.bakdata.conquery.models.query.queryplan.TableExportQueryPlan.TableExportDescription)1 ArrayList (java.util.ArrayList)1