From a6c86f3d04385673f3f131f3e3f99e6a8a5f9fbf Mon Sep 17 00:00:00 2001 From: Yu Zhang Date: Wed, 9 Oct 2024 09:08:50 -0700 Subject: [PATCH] fix(query) the schema provided by _type_ does not match colIDs in the data. --- .../scala/filodb.core/memstore/OnDemandPagingShard.scala | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/src/main/scala/filodb.core/memstore/OnDemandPagingShard.scala b/core/src/main/scala/filodb.core/memstore/OnDemandPagingShard.scala index b200af78f4..48d5e8f568 100644 --- a/core/src/main/scala/filodb.core/memstore/OnDemandPagingShard.scala +++ b/core/src/main/scala/filodb.core/memstore/OnDemandPagingShard.scala @@ -141,6 +141,13 @@ TimeSeriesShard(ref, schemas, storeConfig, numShards, quotaSource, shardNum, buf colIds: Seq[Types.ColumnId], querySession: QuerySession): Observable[ReadablePartition] = { + // To support _type_ query, this filters the data schema that matches the colIds. + if (partLookupRes.firstSchemaId.map(schId => Schemas.global.apply(schId)) + .filter(sch => sch != null) + .exists(sch => sch.data.columns.size <= colIds.max)) { + return Observable.empty + } + capDataScannedPerShardCheck(partLookupRes, colIds, querySession.qContext, querySession.warnings) // For now, always read every data column.