Skip to content

Commit

Permalink
feat: added requested flag to histograms buckets and hierarchy Leve…
Browse files Browse the repository at this point in the history
…lInfos, updated unnecessary second build of the project in CI when building query validator
  • Loading branch information
tpz committed Nov 3, 2023
1 parent 4cd78b6 commit acb8763
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ jobs:
- name: Build query validator
run: |
cd EvitaDB.QueryValidator
dotnet publish -r linux-x64 -c Release -p:PublishSingleFile=true --self-contained false
dotnet publish -r win-x64 -c Release -p:PublishSingleFile=true --self-contained false
dotnet publish -r linux-x64 -c Release -p:PublishSingleFile=true --self-contained false --no-build
dotnet publish -r win-x64 -c Release -p:PublishSingleFile=true --self-contained false --no-build
- name: Zip
uses: vimtor/action-zip@v1
Expand Down
4 changes: 3 additions & 1 deletion EvitaDB.Client/Converters/Models/ResponseConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ GrpcLevelInfo grpcLevelInfo
grpcLevelInfo.Entity is not null
? EntityConverter.ToEntity<ISealedEntity>(entitySchemaFetcher, grpcLevelInfo.Entity, evitaRequest)
: EntityConverter.ToEntityReference(grpcLevelInfo.EntityReference),
grpcLevelInfo.Requested,
grpcLevelInfo.QueriedEntityCount,
grpcLevelInfo.ChildrenCount,
grpcLevelInfo.Items.Select(it => ToLevelInfo(entitySchemaFetcher, evitaRequest, entityFetch, it)).ToList()
Expand Down Expand Up @@ -254,7 +255,8 @@ private static Bucket ToBucket(GrpcHistogram.Types.GrpcBucket grpcBucket)
return new Bucket(
grpcBucket.Index,
EvitaDataTypesConverter.ToDecimal(grpcBucket.Threshold),
grpcBucket.Occurrences
grpcBucket.Occurrences,
grpcBucket.Requested
);
}
}
6 changes: 3 additions & 3 deletions EvitaDB.Client/Models/ExtraResults/Hierarchy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,10 @@ private void AppendLevelInfoTreeString(StringBuilder treeBuilder, LevelInfo leve
}
}

public record LevelInfo(IEntityClassifier Entity, int? QueriedEntityCount, int? ChildrenCount, List<LevelInfo> Children)
public record LevelInfo(IEntityClassifier Entity, bool Requested, int? QueriedEntityCount, int? ChildrenCount, List<LevelInfo> Children)
{
public LevelInfo(LevelInfo levelInfo, List<LevelInfo> children) : this(levelInfo.Entity,
levelInfo.QueriedEntityCount, levelInfo.ChildrenCount, children)
public LevelInfo(LevelInfo levelInfo, List<LevelInfo> children) :
this(levelInfo.Entity, levelInfo.Requested, levelInfo.QueriedEntityCount, levelInfo.ChildrenCount, children)
{
}

Expand Down
2 changes: 1 addition & 1 deletion EvitaDB.Client/Models/ExtraResults/IHistogram.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ public interface IHistogram
public Bucket[] Buckets { get; }
}

public record Bucket(int Index, decimal Threshold, int Occurrences);
public record Bucket(int Index, decimal Threshold, int Occurrences, bool Requested);
4 changes: 4 additions & 0 deletions EvitaDB.Client/Protos/GrpcExtraResults.proto
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ message GrpcHistogram {
// Contains number of entity occurrences in this bucket - e.g. number of entities that has monitored property value
// between previous bucket threshold (exclusive) and this bucket threshold (inclusive)
int32 occurrences = 3;
// Contains true if the `bucket` is overlapping the attribute between filtering constraint
bool requested = 4;
}
// Returns histogram buckets that represents a tuple of occurrence count and the minimal threshold of the bucket
// values.
Expand Down Expand Up @@ -106,6 +108,8 @@ message GrpcLevelInfo {
google.protobuf.Int32Value childrenCount = 4;
// Contains hierarchy info of the entities that are subordinate (children) of this `entity`.
repeated GrpcLevelInfo items = 5;
// Contains true if the `entity` was filtered by hierarchy within constraint
bool requested = 6;
}

// This DTO contains detailed information about query processing time and its decomposition to single operations.
Expand Down

0 comments on commit acb8763

Please sign in to comment.