Skip to content

Commit

Permalink
PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
vishramachandran committed Dec 3, 2024
1 parent 82a40ca commit 17812e2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ trait Histogram extends Ordered[Histogram] {

// now calculate quantile. If bucket is last one and last bucket is +Inf then return second-to-last bucket top
// as we cannot interpolate to +Inf.
if (bucket == numBuckets-1 && bucketTop(numBuckets - 1).isPosInfinity) {
if (bucket == numBuckets-1 && bucketEnd.isPosInfinity) {
return bucketTop(numBuckets-2)
} else if (bucket == 0 && bucketTop(0) <= 0) {
return bucketTop(0) // zero or negative bucket
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ class RateAndMinMaxOverTimeFuncHD(maxColId: Int, minColId: Int) extends ChunkedR
def addChunks(tsVectorAcc: MemoryReader, tsVector: BinaryVectorPtr, tsReader: bv.LongVectorDataReader,
valueVectorAcc: MemoryReader, valueVector: BinaryVectorPtr, valueReader: VectorDataReader,
startTime: Long, endTime: Long, info: ChunkSetInfoReader, queryConfig: QueryConfig): Unit = {
// Do BinarySearch for start/end pos only once for both columns == WIN!
// Do BinarySearch for start/end pos only once for all columns == WIN!
val startRowNum = tsReader.binarySearch(tsVectorAcc, tsVector, startTime) & 0x7fffffff
val endRowNum = Math.min(tsReader.ceilingIndex(tsVectorAcc, tsVector, endTime), info.numRows - 1)

Expand All @@ -403,7 +403,7 @@ class RateAndMinMaxOverTimeFuncHD(maxColId: Int, minColId: Int) extends ChunkedR
val maxVectPtr = info.vectorAddress(maxColId)
maxFunc.addTimeChunks(maxVectAcc, maxVectPtr, bv.DoubleVector(maxVectAcc, maxVectPtr), startRowNum, endRowNum)

// Get valueVector/reader for max column
// Get valueVector/reader for min column
val minVectAcc = info.vectorAccessor(minColId)
val minVectPtr = info.vectorAddress(minColId)
minFunc.addTimeChunks(minVectAcc, minVectPtr, bv.DoubleVector(minVectAcc, minVectPtr), startRowNum, endRowNum)
Expand Down

0 comments on commit 17812e2

Please sign in to comment.