Skip to content

Commit f477994

Browse files
author
Ganeshwara Hananda
authored
Refine the implementation of NumericGroup and Numeric (#102)
## What is the goal of this PR? We have refined the protocol for returning `Numeric` and `NumericGroup` which are used by match aggregate and match group aggregate respectively. ## What are the changes implemented in this PR? 1. Enrich the representation of `Numeric` such that it can represent long, double, or NaN (not a number) 2. Fix the fact that `NumericGroup` has a list of `Number` rather than `Number`
1 parent aaf44f3 commit f477994

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

protobuf/answer.proto

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,15 @@ message ConceptMapGroup {
3434
repeated ConceptMap concept_maps = 2;
3535
}
3636

37-
message Number {
38-
string value = 1;
39-
// We use a string to contain the full representation of a number
37+
message Numeric {
38+
oneof value {
39+
int64 long_value = 1;
40+
double double_value = 2;
41+
bool nan = 3;
42+
}
4043
}
4144

42-
message NumberGroup {
45+
message NumericGroup {
4346
Concept owner = 1;
44-
repeated Number numbers = 2;
47+
Numeric number = 2;
4548
}

protobuf/query.proto

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ message Query {
6969
}
7070

7171
message Res {
72-
Number answer = 1;
72+
Numeric answer = 1;
7373
}
7474
}
7575

@@ -89,7 +89,7 @@ message Query {
8989
}
9090

9191
message Res {
92-
repeated NumberGroup answers = 1;
92+
repeated NumericGroup answers = 1;
9393
}
9494
}
9595

0 commit comments

Comments
 (0)