jon-wei commented on a change in pull request #7588: multi-value string column support for expressions URL: https://github.com/apache/incubator-druid/pull/7588#discussion_r291412283
########## File path: docs/content/misc/math-expr.md ########## @@ -39,22 +40,31 @@ This expression language supports the following operators (listed in decreasing |<, <=, >, >=, ==, !=|Binary Comparison| |&&, ||Binary Logical AND, OR| -Long, double, and string data types are supported. If a number contains a dot, it is interpreted as a double, otherwise it is interpreted as a long. That means, always add a '.' to your number if you want it interpreted as a double value. String literals should be quoted by single quotation marks. +Long, double, and string data types are supported. If a number contains a dot, it is interpreted as a double, otherwise +it is interpreted as a long. That means, always add a '.' to your number if you want it interpreted as a double value. +String literals should be quoted by single quotation marks. -Multi-value types are not fully supported yet. Expressions may behave inconsistently on multi-value types, and you -should not rely on the behavior in this case to stay the same in future releases. +Additionally, the expression language supports long, double, and string arrays. Array literals are created by wrapping +square brackets around a list of scalar literals values delimited by a comma or space character. All values in an array +literal must be the same type. -Expressions can contain variables. Variable names may contain letters, digits, '\_' and '$'. Variable names must not begin with a digit. To escape other special characters, you can quote it with double quotation marks. +Expressions can contain variables. Variable names may contain letters, digits, '\_' and '$'. Variable names must not +begin with a digit. To escape other special characters, you can quote it with double quotation marks. -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)'. +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 are supported and may be treated as either scalar or array typed values. When treated as Review comment: Suggest mentioning that expression postaggs won't normally see array types because of the unnesting behavior of TopN and GroupBy, and maybe mention `array_to_string` and `string_to_array` as a way to pass arrays to expr postaggs ---------------------------------------------------------------- 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] With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
