gianm commented on PR #12576:
URL: https://github.com/apache/druid/pull/12576#issuecomment-1141735965

   The bug fixes look good to me so I merged them.
   
   > While writing a test to fix this 2nd issue, I encountered a 3rd issue 
involving the way grouping works whe the `ListFilteredVirtualColumn` is used as 
an expression input, but I think could happen with any dimension selector that 
returns `IndexedInts` as 0 length rows, and is using the "deferred" evaluation 
expression selector (which saves expression evaluation until after the 
grouping). However, the 0 length row is grouped as the "missing" value, which 
means that there is no dictionary id to lookup - which is what evaluates the 
expression in the deferred expression dimension selectors, and so this null 
value is not actually used as an input to an expression and so remains null. 
I'm still trying to determine the best way to fix this problem. As far as I can 
tell, it should only affect the "deferred" evaluation expression dimension 
selectors when used with a grouping engine and delegating to any selector that 
can return an `IndexedInts` of size 0 for the row.
   
   On this piece, I guess you're talking about an expression that treats the 
input in scalar context, because that's when the deferred evaluation approach 
would get used. In this case we're doing an implicit map over the inputs. What 
is the expected behavior when there are no inputs? (Do we have it documented?)
   
   IMO a reasonable approach is for the output to be `[]` regardless of what 
the expression is. In that case, the deferred evaluation approach works just 
fine, since it always maps `[]` to `[]`. Then, grouping turns that into a 
`null`, which is normal for grouping on `[]` in string context.


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