@Override public QueryExecution query(RequestContext context, List<FunnelStep> steps, Optional<String> dimension, Optional<String> segment, LocalDate startDate, LocalDate endDate, Optional<FunnelWindow> window, ZoneId zoneId, Optional<List<String>> connectors, FunnelType funnelType) { if (funnelType != FunnelType.ORDERED) { return fastExecutor.query(context, steps, dimension, segment, startDate, endDate, window, zoneId, connectors, funnelType); } if (dimension.isPresent() && projectConfig.getUserColumn().equals(dimension.get())) { throw new RakamException("Dimension and connector field cannot be equal", HttpResponseStatus.BAD_REQUEST); } return super.query(context, steps, dimension, segment, startDate, endDate, window, zoneId, connectors, funnelType); }
.mapToObj(i -> convertFunnel( context.project, connectors.orElse(ImmutableList.of(testDeviceIdExists(steps.get(i), collections) ? ("coalesce(cast(%s." + checkTableColumn(projectConfig.getUserColumn()) + " as varchar), _device_id) as " + checkTableColumn(projectConfig.getUserColumn())) : projectConfig.getUserColumn())) .stream().collect(Collectors.joining(", ")), i, steps.get(i), dimension, segment, startDate, endDate)) String query = format(getTemplate(steps, dimension, window), dimensionCol, dimensionCol, ctes, TIMESTAMP_FORMATTER.format(startDate.atStartOfDay()), TIMESTAMP_FORMATTER.format(endDate.plusDays(1).atStartOfDay()),
@Override public QueryExecution query(RequestContext context, List<FunnelStep> steps, Optional<String> dimension, Optional<String> segment, LocalDate startDate, LocalDate endDate, Optional<FunnelWindow> window, ZoneId zoneId, Optional<List<String>> connectors, FunnelType funnelType) { if (funnelType == FunnelType.APPROXIMATE) { return approxFunnelQueryExecutor.query(context, steps, dimension, segment, startDate, endDate, window, zoneId, connectors, funnelType); } if (funnelType != FunnelType.ORDERED) { return fastPrestoFunnelQueryExecutor.query(context, steps, dimension, segment, startDate, endDate, window, zoneId, connectors, funnelType); } if (dimension.isPresent() && projectConfig.getUserColumn().equals(dimension.get())) { throw new RakamException("Dimension and connector field cannot be equal", HttpResponseStatus.BAD_REQUEST); } return super.query(context, steps, dimension, segment, startDate, endDate, window, zoneId, connectors, funnelType); }