Skip to content

Commit

Permalink
Fix for scalar plans from PR review
Browse files Browse the repository at this point in the history
  • Loading branch information
amolnayak311 committed Jan 22, 2024
1 parent c185a0d commit 082b9a2
Showing 1 changed file with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -683,18 +683,21 @@ object PlannerUtil extends StrictLogging {
.asInstanceOf[PeriodicSeriesPlan],
functionArgs = lp.functionArgs.map(
rewritePlanWithRemoteRawExport(_, rangeSelector, additionalLookbackMs).asInstanceOf[FunctionArgsPlan]))
case lp: ScalarTimeBasedPlan => lp
case lp: ScalarTimeBasedPlan => lp.copy(
rangeParams = lp.rangeParams.copy(startSecs = rangeSelector.from / 1000L, endSecs = rangeSelector.to / 1000L))
case lp: VectorPlan =>
lp.copy(scalars = rewritePlanWithRemoteRawExport(lp.scalars, rangeSelector, additionalLookbackMs)
.asInstanceOf[ScalarPlan])
case lp: ScalarFixedDoublePlan => lp
case lp: ScalarFixedDoublePlan => lp.copy(timeStepParams =
lp.timeStepParams.copy(startSecs = rangeSelector.from / 1000L, endSecs = rangeSelector.to / 1000L))
case lp: ApplyAbsentFunction =>
lp.copy(vectors = rewritePlanWithRemoteRawExport(lp.vectors, rangeSelector, additionalLookbackMs)
.asInstanceOf[PeriodicSeriesPlan])
case lp: ApplyLimitFunction =>
lp.copy(vectors = rewritePlanWithRemoteRawExport(lp.vectors, rangeSelector, additionalLookbackMs)
.asInstanceOf[PeriodicSeriesPlan])
case lp: ScalarBinaryOperation => lp
case lp: ScalarBinaryOperation => lp.copy(
rangeParams = lp.rangeParams.copy(startSecs = rangeSelector.from / 1000L, endSecs = rangeSelector.to / 1000L))
case lp: SubqueryWithWindowing =>
lp.copy(innerPeriodicSeries =
rewritePlanWithRemoteRawExport(lp.innerPeriodicSeries, rangeSelector, additionalLookbackMs)
Expand All @@ -711,19 +714,19 @@ object PlannerUtil extends StrictLogging {
val newLookback = lp.lookbackMs.getOrElse(0L) + lp.offsetMs.getOrElse(0L) + additionalLookbackMs
lp.copy(supportsRemoteDataCall = true, rangeSelector = rangeSelector,
lookbackMs = if (newLookback == 0) None else Some(newLookback), offsetMs = None)
case lp: RawChunkMeta => lp
case lp: RawChunkMeta => lp.copy(rangeSelector = rangeSelector)
case lp: PeriodicSeries =>
lp.copy(rawSeries = rewritePlanWithRemoteRawExport(lp.rawSeries, rangeSelector, additionalLookbackMs)
.asInstanceOf[RawSeriesLikePlan], startMs = rangeSelector.from, endMs = rangeSelector.to)
case lp: PeriodicSeriesWithWindowing =>
val rs = rangeSelector.asInstanceOf[IntervalSelector]
lp.copy(
startMs = rs.from,
endMs = rs.to,
startMs = rangeSelector.from,
endMs = rangeSelector.to,
functionArgs = lp.functionArgs.map(
rewritePlanWithRemoteRawExport(_, rangeSelector, additionalLookbackMs).asInstanceOf[FunctionArgsPlan]),
series = rewritePlanWithRemoteRawExport(lp.series, rangeSelector, additionalLookbackMs)
.asInstanceOf[RawSeriesLikePlan])
// wont bother rewriting and adjusting the start and end for metadata calls
case lp: MetadataQueryPlan => lp
case lp: TsCardinalities => lp
}
Expand Down

0 comments on commit 082b9a2

Please sign in to comment.