gortiz opened a new pull request, #16853:
URL: https://github.com/apache/pinot/pull/16853

   Recently, the following bug was reported on Apache Pinot slack 
([link](https://apache-pinot.slack.com/archives/CDRCA57FC/p1758127794636609)):
   
   Using ColocatedQuickStart, the following query:
   ```sql
   select 
   userUUID,
   LAG(totalTrips, 1, 3) OVER (PARTITION BY userUUID ORDER BY deviceOS) AS 
prev_is_active
   from userAttributes 
   order by deviceOS
   limit 10
   ```
   
   Fails with:
   
   ```
   Received 1 error from stage 2 on Server_192.168.1.93_7050: class 
java.lang.String cannot be cast to class java.lang.Number (java.lang.String and 
java.lang.Number are in module java.base of loader 'bootstrap')
   ```
   
   If we weren't providing a default value for the LAG function (its 3rd 
argument). The reason is very simple, when we try to assign a type to that 
default value, we used the type of the _first input_ (in this case `userUUID`, 
whose type is String). The fix is to use the type of the expression itself or 
even easier, the type of the function itself, which is what I'm doing on this 
PR.
   
   I've also added a test, which fails in master but works here.


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