You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2022/05/01 12:02:46 UTC

[GitHub] [iotdb] SteveYurongSu commented on a diff in pull request #5744: [IOTDB-3048] Refactor binary transformer

SteveYurongSu commented on code in PR #5744:
URL: https://github.com/apache/iotdb/pull/5744#discussion_r862464593


##########
server/src/main/java/org/apache/iotdb/db/query/udf/core/transformer/binary/CompareNonEqualTransformer.java:
##########
@@ -29,12 +33,24 @@ public CompareNonEqualTransformer(
   }
 
   @Override
-  protected TransformerType getTransformerType() {
-    return TransformerType.EqNeq;
+  protected void transformAndCache() throws QueryProcessException, IOException {
+    if (leftPointReader.getDataType() == TSDataType.BOOLEAN
+        && rightPointReader.getDataType() == TSDataType.BOOLEAN) {
+      cachedBoolean = evaluate(leftPointReader.currentBoolean(), rightPointReader.currentBoolean());
+    } else {
+      cachedBoolean =
+          evaluate(
+              castCurrentValueToDoubleOperand(leftPointReader),
+              castCurrentValueToDoubleOperand(rightPointReader));
+    }
+  }
+
+  protected boolean evaluate(boolean leftOperand, boolean rightOperand) {
+    return leftOperand == rightOperand;

Review Comment:
   ```suggestion
       return leftOperand != rightOperand;
   ```



-- 
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: reviews-unsubscribe@iotdb.apache.org

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