gianm commented on code in PR #15058: URL: https://github.com/apache/druid/pull/15058#discussion_r1351508852
########## docs/configuration/index.md: ########## @@ -800,6 +800,7 @@ Prior to version 0.13.0, Druid string columns treated `''` and `null` values as |Property|Description|Default| |---|---|---| |`druid.generic.useDefaultValueForNull`|Set to `false` to store and query data in SQL compatible mode. When set to `true` (legacy mode), `null` values will be stored as `''` for string columns and `0` for numeric columns.|`false`| +|`druid.generic.useThreeValueLogic`|Set to `true` to use SQL compatible three-value logic when processing Druid filters when `druid.generic.useDefaultValueForNull` is `false` and `druid.expressions.useStrictBooleans` is `true`. When set to `false` Druid uses 2 value logic for filter processing, even when `druid.generic.useDefaultValueForNull=false` and `druid.expressions.useStrictBooleans` is true.|`true`| Review Comment: Shouldn't this be `druid.generic.useThreeValueLogicForNativeFilters`? A mouthful, but isn't 3VL still used inside expressions when strict booleans is true and this is false? Also, nit: consistency between "`druid.generic.useDefaultValueForNull=false`" vs "`druid.expressions.useStrictBooleans` is true" Also, suggest linking to `../querying/sql-data-types.md` for more info. ########## docs/querying/sql-data-types.md: ########## @@ -152,14 +152,14 @@ values are treated as zeroes. This was the default prior to Druid 28.0.0. ## Boolean logic -The [`druid.expressions.useStrictBooleans`](../configuration/index.md#expression-processing-configurations) -runtime property controls Druid's boolean logic mode. For the most SQL compliant behavior, set this to `true` (the default). +By default, Druid uses [SQL three-valued logic](https://en.wikipedia.org/wiki/Three-valued_logic#SQL) for filter processing Review Comment: Hmm, we should add mention about this parameter to `querying/filters.md` too. This doc is all about SQL, but the same issue affects filters in native queries. ########## docs/querying/sql-data-types.md: ########## @@ -152,14 +152,14 @@ values are treated as zeroes. This was the default prior to Druid 28.0.0. ## Boolean logic -The [`druid.expressions.useStrictBooleans`](../configuration/index.md#expression-processing-configurations) -runtime property controls Druid's boolean logic mode. For the most SQL compliant behavior, set this to `true` (the default). +By default, Druid uses [SQL three-valued logic](https://en.wikipedia.org/wiki/Three-valued_logic#SQL) for filter processing +and boolean expression evaluation. This behavior relies on three settings: -When `druid.expressions.useStrictBooleans = true`, Druid uses [three-valued logic](https://en.wikipedia.org/wiki/Three-valued_logic#SQL) for -[expressions](math-expr.md) evaluation, such as `expression` virtual columns or `expression` filters. -If `druid.generic.useDefaultValueForNull = false` (in combination with `druid.expressions.useStrictBooleans = true`), Druid also uses three-valued logic for native filters. +* [`druid.generic.useDefaultValueForNull`](../configuration/index.md#sql-compatible-null-handling) set to false (default), a runtime property which allows NULL values to exist in numeric columns and expressions, and string typed columns to distinguish between NULL and the empty string Review Comment: Clearer to replace "set to false" with "must be set to false" (& similar comments for other bullets) -- 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]
