clintropolis commented on code in PR #18334:
URL: https://github.com/apache/druid/pull/18334#discussion_r2246448063


##########
processing/src/main/java/org/apache/druid/segment/virtual/ExpressionVirtualColumn.java:
##########
@@ -367,13 +369,14 @@ public boolean equals(final Object o)
     }
     final ExpressionVirtualColumn that = (ExpressionVirtualColumn) o;
     return Objects.equals(name, that.name) &&
-           Objects.equals(expression, that.expression);
+           Objects.equals(expression.expressionString, 
that.expression.expressionString) &&
+           Objects.equals(expression.outputType, that.expression.outputType);
   }
 
   @Override
   public int hashCode()
   {
-    return Objects.hash(name, expression);
+    return Objects.hash(name, expression.expressionString, 
expression.outputType);

Review Comment:
   `expressionString` is the raw expression as input by the user from the json, 
stringifying the parsed expression homogenizes this so `a+b` and `a + b` and 
`"a" + "b"` become the same expr after being parsed. (this is the reason the 
equivalence check was broken, using the raw input strings is not correct 
because the user could write the same expression in a lot of different ways) 



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to