amrishlal commented on a change in pull request #6811:
URL: https://github.com/apache/incubator-pinot/pull/6811#discussion_r620895795



##########
File path: 
pinot-common/src/main/java/org/apache/pinot/common/utils/request/RequestUtils.java
##########
@@ -151,7 +157,10 @@ public static Expression getLiteralExpression(byte[] 
value) {
   }
 
   public static Expression getLiteralExpression(Object object) {
-    if (object instanceof Integer || object instanceof Long) {
+    if (object instanceof Integer) {

Review comment:
       The assert on Line 107 in QueryOptimizerTest.java is:
   
   ```assertEquals(children.get(0), getEqFilterExpression("int", 4));```
   
   where `children.get(0)` is:
   ```
   Expression(type:FUNCTION, functionCall:Function(operator:EQUALS,
      operands:[
            Expression(type:IDENTIFIER, identifier:Identifier(name:int)),
            Expression(type:LITERAL, literal:<Literal intValue:4>)
      ]
   ))
   ```
   The second operand of the expression above is an INT literal with value 4 
because it got type casted to match the type of the column which is INT (INT 
literal matching INT column).
   
   To make the assertEquals statement pass, `getEqFilterExpression("int", 4)` 
should return an INT literal; however, currently it is returning a LONG 
literal. To make `getEqFilterExpression("int", 4)` return INT literal, we need 
to modify the getLiteralExpression function as has been done above.
   




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

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



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to