wu-sheng commented on code in PR #155:
URL: 
https://github.com/apache/skywalking-banyandb/pull/155#discussion_r946773671


##########
api/proto/banyandb/model/v1/query.proto:
##########
@@ -68,8 +72,23 @@ message Condition {
 
 // tag_families are indexed.
 message Criteria {
-    string tag_family_name = 1;
-    repeated model.v1.Condition conditions = 2;
+   repeated LogicalExpression les = 1;
+   repeated Criteria inners = 2;
+}
+
+// LogicalExpression supports logical operation
+message LogicalExpression {
+    enum LogicalOp {
+        LOGICAL_OP_UNSPECIFIED = 0;
+        LOGICAL_OP_AND = 1;
+        LOGICAL_OP_OR = 2; 
+    }
+    // op is a logial operation
+    LogicalOp op = 1;
+    // tag_family_name indicates the tag family to which the tag name in the 
condition belongs.
+    string tag_family_name = 2;
+    // condition is a binary operation
+    model.v1.Condition condition = 3; 
 }

Review Comment:
   In our discussion, as you want to separate logic expression and op 
condition, I want to propose this one,
   
   ```proto
   
   // tag_families are indexed.
   message Criteria {
      enum LogicalOp {
           LOGICAL_OP_UNSPECIFIED = 0;
           LOGICAL_OP_AND = 1;
           LOGICAL_OP_OR = 2; 
       }
       // op is a logial operation
      LogicalOp op = 1;
      repeated LogicalExpression les = 2;
   }
   
   // LogicalExpression supports logical operation
   message LogicalExpression {
       value oneof {
           ConditionExpression = 1;
           Criteria = 2;
       }
   }
   
   message ConditionExpression {
       // tag_family_name indicates the tag family to which the tag name in the 
condition belongs.
       string tag_family_name = 1;
       // condition is a binary operation
       model.v1.Condition condition = 2; 
   }
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to