Skip to content

Commit

Permalink
fix(query) the schema provided by _type_ does not match colIDs in the…
Browse files Browse the repository at this point in the history
… data.
  • Loading branch information
Yu Zhang committed Oct 10, 2024
1 parent 22d0b08 commit d2cc6b5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions core/src/main/scala/filodb.core/metadata/Schemas.scala
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,8 @@ final case class Schemas(part: PartitionSchema,
val numSamplesPerChunk = chunkDurationMillis / resolutionMs
// find number of chunks to be scanned. Ceil division needed here
val numChunksPerTs = (queryDurationMs + chunkDurationMillis - 1) / chunkDurationMillis
val bytesPerSample = colIds.map(c => bytesPerSampleSwag((schemaId, c))).sum
// The schema provided does not match existing, give the the sample a weight of histogram.
val bytesPerSample = colIds.map(c => bytesPerSampleSwag.getOrElse((schemaId, c), 20.0)).sum
val estDataSize = bytesPerSample * numTsPartitions * numSamplesPerChunk * numChunksPerTs
estDataSize
}
Expand All @@ -327,7 +328,8 @@ final case class Schemas(part: PartitionSchema,
chunkMethod: ChunkScanMethod
): Double = {
val numSamplesPerChunk = chunkDurationMillis / resolutionMs
val bytesPerSample = colIds.map(c => bytesPerSampleSwag((schemaId, c))).sum
// The schema provided does not match existing, give the the sample a weight of histogram.
val bytesPerSample = colIds.map(c => bytesPerSampleSwag.getOrElse((schemaId, c), 20.0)).sum
var estDataSize = 0d
pkRecs.foreach { pkRec =>
val intersection = Math.min(chunkMethod.endTime, pkRec.endTime) - Math.max(chunkMethod.startTime, pkRec.startTime)
Expand Down

0 comments on commit d2cc6b5

Please sign in to comment.