/** * Stores the request table name and intervals and creates a predicate to test a physical table based on request * intervals. * * @param requestConstraint Contains the request constraints extracted from DataApiRequest and TemplateDruidQuery */ public TimeAlignmentPhysicalTableMatcher(QueryPlanningConstraint requestConstraint) { if (requestConstraint.getIntervals().isEmpty()) { throw new IllegalStateException("Intervals cannot be empty"); } logicalTableName = requestConstraint.getLogicalTable().getName(); requestIntervals = requestConstraint.getIntervals(); isTableAligned = new IsTableStartAlignedWithIntervals(requestConstraint.getIntervals()); }
@Override public NoMatchFoundException noneFoundException() { String logicalTableName = requestConstraint.getLogicalTable().getName(); Set<String> logicalMetrics = requestConstraint.getLogicalMetricNames(); Set<String> dimensions = requestConstraint.getAllDimensionNames(); String grainName = requestConstraint.getMinimumGranularity().getName(); LOG.error(MESSAGE_FORMAT.logFormat(logicalTableName, dimensions, logicalMetrics, grainName)); return new NoMatchFoundException( MESSAGE_FORMAT.format(logicalTableName, dimensions, logicalMetrics, grainName)); } }