clintropolis commented on a change in pull request #11254:
URL: https://github.com/apache/druid/pull/11254#discussion_r632837576



##########
File path: docs/misc/math-expr.md
##########
@@ -50,7 +50,7 @@ Expressions can contain variables. Variable names may contain 
letters, digits, '
 
 For logical operators, a number is true if and only if it is positive (0 or 
negative value means false). For string type, it's the evaluation result of 
'Boolean.valueOf(string)'.
 
-[Multi-value string dimensions](../querying/multi-value-dimensions.md) are 
supported and may be treated as either scalar or array typed values. When 
treated as a scalar type, an expression will automatically be transformed to 
apply the scalar operation across all values of the multi-valued type, to mimic 
Druid's native behavior. Values that result in arrays will be coerced back into 
the native Druid string type for aggregation. Druid aggregations on multi-value 
string dimensions on the individual values, _not_ the 'array', behaving similar 
to the `UNNEST` operator available in many SQL dialects. However, by using the 
`array_to_string` function, aggregations may be done on a stringified version 
of the complete array, allowing the complete row to be preserved. Using 
`string_to_array` in an expression post-aggregator, allows transforming the 
stringified dimension back into the true native array type.
+[Multi-value string dimensions](../querying/multi-value-dimensions.md) are 
supported and may be treated as either scalar or array typed values. When 
treated as a scalar type, an expression will automatically be transformed to 
apply the scalar operation across all values of the multi-valued type, to mimic 
Druid's native behavior. Values that result in arrays will be coerced back into 
the native Druid string type for aggregation. Druid aggregations on multi-value 
string dimensions act on the individual values, _not_ the 'array', behaving 
similar to the `UNNEST` operator available in many SQL dialects. However, by 
using the `array_to_string` function, aggregations may be done on a stringified 
version of the complete array, allowing the complete row to be preserved. Using 
`string_to_array` in an expression post-aggregator, allows transforming the 
stringified dimension back into the true native array type.

Review comment:
       Oh man, no idea why I worded this so strange back in #7588.. i wonder if 
something like this would be a bit clearer:
   
   > Values that result in arrays will be coerced back into the native Druid 
string type for grouping and aggregation. Grouping on multi-value string 
dimensions in Druid will group by the individual values, _not_ the 'array', 
behaving similar to the `UNNEST` operator available in many SQL dialects.




-- 
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:
[email protected]



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

Reply via email to