clintropolis commented on a change in pull request #8894: document SQL compatible null handling mode URL: https://github.com/apache/incubator-druid/pull/8894#discussion_r348299812
########## File path: docs/querying/sql.md ########## @@ -115,14 +115,19 @@ milliseconds since 1970-01-01 00:00:00 UTC, not counting leap seconds. Therefore timezone information, but only carry information about the exact moment in time they represent. See the [Time functions](#time-functions) section for more information about timestamp handling. -Druid generally treats NULLs and empty strings interchangeably, rather than according to the SQL standard. As such, -Druid SQL only has partial support for NULLs. For example, the expressions `col IS NULL` and `col = ''` are equivalent, +### Default Null handling +By default Druid treats NULLs and empty strings interchangeably, rather than according to the SQL standard. As such, +in this mode Druid SQL only has partial support for NULLs. For example, the expressions `col IS NULL` and `col = ''` are equivalent, and both will evaluate to true if `col` contains an empty string. Similarly, the expression `COALESCE(col1, col2)` will return `col2` if `col1` is an empty string. While the `COUNT(*)` aggregator counts all rows, the `COUNT(expr)` aggregator will count the number of rows where expr is neither null nor the empty string. String columns in Druid are NULLable. Numeric columns are NOT NULL; if you query a numeric column that is not present in all segments of your Druid datasource, then it will be treated as zero for rows from those segments. +### SQL compatible null handling Review comment: combined sections and mentioned optimizer ---------------------------------------------------------------- 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]
