PragmaTwice commented on code in PR #2232:
URL: https://github.com/apache/kvrocks/pull/2232#discussion_r1556810917


##########
src/search/ir_plan.h:
##########
@@ -0,0 +1,117 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+#pragma once
+
+#include <limits>
+#include <memory>
+
+#include "ir.h"
+#include "search/ir_sema_checker.h"
+#include "string_util.h"
+
+namespace kqir {
+
+namespace plan {
+
+struct PlanOperator : Node {};
+
+struct FullIndexScan : PlanOperator {
+  IndexInfo *index;
+
+  std::string_view Name() const override { return "FullIndexScan"; };
+  std::string Content() const override { return index->name; };
+  std::string Dump() const override { return fmt::format("full-scan {}", 
Content()); }
+};
+
+struct FieldScan : PlanOperator {
+  FieldInfo *field;
+};
+
+struct Interval {
+  double l, r;  // [l, r)
+
+  std::string ToString() const { return fmt::format("[{}, {})", l, r); }
+};
+
+struct NumericFieldScan : FieldScan {
+  Interval range;
+
+  std::string_view Name() const override { return "NumericFieldScan"; };
+  std::string Content() const override { return fmt::format("{}, {}", 
field->name, range.ToString()); };
+  std::string Dump() const override { return fmt::format("numeric-scan {}", 
Content()); }
+};
+
+struct TagFieldScan : FieldScan {
+  std::string tag;
+
+  std::string_view Name() const override { return "TagFieldScan"; };
+  std::string Content() const override { return fmt::format("{}, {}", 
field->name, tag); };
+  std::string Dump() const override { return fmt::format("tag-scan {}", 
Content()); }

Review Comment:
   I cannot get you. Please be more specific : )



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to