@@ -626,7 +626,7 @@ case class EmptyHistogramException(message: String) extends IllegalArgumentExcep
626626 * A reader for SectDelta encoded histograms, including correction/drop functionality
627627 */
628628class SectDeltaHistogramReader (acc2 : MemoryReader , histVect : Ptr .U8 )
629- extends RowHistogramReader (acc2, histVect) with CounterHistogramReader {
629+ extends RowHistogramReader (acc2, histVect) with CounterHistogramReader with StrictLogging {
630630 // baseHist is section base histogram; summedHist used to compute base + delta or other sums
631631 private val summedHist = LongHistogram .empty(buckets)
632632 private val baseHist = summedHist.copy
@@ -683,11 +683,18 @@ class SectDeltaHistogramReader(acc2: MemoryReader, histVect: Ptr.U8)
683683 // code to go through and build a list of corrections and corresponding index values.. (dropIndex, correction)
684684 private lazy val corrections = {
685685 var index = 0
686+ var dropped = false
686687 // Step 1: build an iterator of (starting-index, section) for each section
687- iterateSections.map { case (s) => val o = (index, s); index += s.numElements(acc); o }.collect {
688+ val correctionData = iterateSections.map { case (s) => val o = (index, s); index += s.numElements(acc); o }.collect {
688689 case (i, s) if i > 0 && s.sectionType(acc) == Section .TypeDrop =>
690+ dropped = true
689691 (i, apply(i - 1 ).asInstanceOf [LongHistogram ].copy)
690692 }.toBuffer
693+ if (dropped) {
694+ logger.warn(s " detected counter reset in histogram correction= ${corrections}\n " +
695+ s " allSections= ${dumpAllSections}" )
696+ }
697+ correctionData
691698 }
692699
693700 def dropPositions (accNotUsed : MemoryReader , vectorNotUsed : BinaryVectorPtr ): debox.Buffer [Int ] = {
0 commit comments