gortiz commented on PR #13618:
URL: https://github.com/apache/pinot/pull/13618#issuecomment-2230560722

   > Technically, ARRAY_TO_MV is deterministic right since it is guaranteed to 
always return the same result given the same operands? Essentially, we're never 
going to get a different result for something like ARRAY_TO_MV(RandomAirports) 
= 'MFR' when applied to the same row
   
   No. ARRAY_TO_MV is not deterministic. The definition is that the result is 
the same for the same inputs. That semantic is what give Calcite permission to 
simplify `ARRAY_TO_MV(RandomAirports) = 'MFR' AND ARRAY_TO_MV(RandomAirports) = 
'GTR'` as `false`. Given `ARRAY_TO_MV(RandomAirports)` is deterministic and MFR 
is different than GTR, it means that AND must always evaluate to false.
   
   What you are saying is that `ARRAY_TO_MV(RandomAirports) = 'MFR' ` is 
deterministic, which is true, but there what is deterministic is `=`, not 
`ARRAY_TO_MV`. Anyway, `ARRAY_TO_MV` semantics are ill defined. That function 
is actually doesn't have semantic, is used just to trick Calcite validator. In 
fact `ARRAY_TO_MV` cannot be executed in V1 and it is removed before sending 
the query in leaf stage. What V1 sees is `RandomAirports = 'MFR'` and V1 
includes some historical semantic for `=` applied to multi-values and scalars


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