This is an automated email from the ASF dual-hosted git repository.

hui pushed a commit to branch lmh/addJoinNode
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit f81a9d9da902dfcafd9d0b7705207329daf6e391
Author: Minghui Liu <[email protected]>
AuthorDate: Wed Dec 20 11:22:10 2023 +0800

    add comment
---
 .../plan/node/process/join/FullOuterTimeJoinNode.java  | 18 +++++++++++++++---
 .../plan/node/process/join/InnerTimeJoinNode.java      | 16 ++++++++++++++++
 .../plan/node/process/join/LeftOuterTimeJoinNode.java  | 18 ++++++++++++++++++
 3 files changed, 49 insertions(+), 3 deletions(-)

diff --git 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/plan/node/process/join/FullOuterTimeJoinNode.java
 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/plan/node/process/join/FullOuterTimeJoinNode.java
index 5b21ccaabe6..750bc2bfc00 100644
--- 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/plan/node/process/join/FullOuterTimeJoinNode.java
+++ 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/plan/node/process/join/FullOuterTimeJoinNode.java
@@ -35,10 +35,22 @@ import java.util.Objects;
 import java.util.stream.Collectors;
 
 /**
- * This node is responsible for join two or more TsBlock.
+ * This node is responsible for joining two or more TsBlock.
  *
- * <p>The join algorithm is like <b>full outer join</b> by timestamp column. 
It will join two or
- * more TsBlock by Timestamp column. The output result of TimeJoinOperator is 
sorted by timestamp.
+ * <p>The join algorithm is <b>full outer join</b> on timestamp column —— take 
the <b>union</b> of
+ * all child timestamps as the time column of the result. If a timestamp does 
not exist in one
+ * child, it will be null in the corresponding row of the result. The output 
result is sorted by
+ * timestamp.
+ *
+ * <p>e.g.
+ *
+ * <pre>
+ *   [series1]  [series2]  [series1 join series2]
+ *   time, s1   time, s2   time,   s1,   s2
+ *      1,  1                 1,    1, null
+ *      2,  2      2,  2      2,    2,    2
+ *                 3,  3      3, null,    3
+ * </pre>
  */
 public class FullOuterTimeJoinNode extends MultiChildProcessNode {
 
diff --git 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/plan/node/process/join/InnerTimeJoinNode.java
 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/plan/node/process/join/InnerTimeJoinNode.java
index 42fda408817..aae1cea6428 100644
--- 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/plan/node/process/join/InnerTimeJoinNode.java
+++ 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/plan/node/process/join/InnerTimeJoinNode.java
@@ -35,6 +35,22 @@ import java.util.List;
 import java.util.Objects;
 import java.util.stream.Collectors;
 
+/**
+ * This node is responsible for joining two or more TsBlock.
+ *
+ * <p>The join algorithm is <b>inner join</b> on timestamp column —— take the 
<b>intersection</b> of
+ * all child timestamps as the time column of the result. The output result is 
sorted by timestamp.
+ *
+ * <p>e.g.
+ *
+ * <pre>
+ *   [series1]  [series2]  [series1 join series2]
+ *   time, s1   time, s2   time, s1, s2
+ *      1,  1
+ *      2,  2      2,  2      2,  2,  2
+ *                 3,  3
+ * </pre>
+ */
 public class InnerTimeJoinNode extends MultiChildProcessNode {
 
   // This parameter indicates the order when executing multiway merge sort.
diff --git 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/plan/node/process/join/LeftOuterTimeJoinNode.java
 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/plan/node/process/join/LeftOuterTimeJoinNode.java
index 0fd83f4c04e..399eba05d21 100644
--- 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/plan/node/process/join/LeftOuterTimeJoinNode.java
+++ 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/plan/node/process/join/LeftOuterTimeJoinNode.java
@@ -33,6 +33,24 @@ import java.nio.ByteBuffer;
 import java.util.List;
 import java.util.Objects;
 
+/**
+ * This node is responsible for joining two TsBlock.
+ *
+ * <p>The join algorithm is <b>left join</b> on timestamp column —— take the 
time column of the
+ * <b>left child</b> as the time column of the result. If a timestamp does not 
exist in the right
+ * child, it will be null in the corresponding row of the result. The output 
result is sorted by
+ * timestamp.
+ *
+ * <p>e.g.
+ *
+ * <pre>
+ *   [series1]  [series2]  [series1 join series2]
+ *   time, s1   time, s2   time, s1,   s2
+ *      1,  1                 1,  1, null
+ *      2,  2      2,  2      2,  2,    2
+ *                 3,  3
+ * </pre>
+ */
 public class LeftOuterTimeJoinNode extends TwoChildProcessNode {
 
   // This parameter indicates the order when executing multiway merge sort.

Reply via email to