Hey folks, question: is `ListFilteredDimensionSpec...
# dev
j
Hey folks, question: is
ListFilteredDimensionSpec
not allowed to have
null
as an element in its
values
array? Or is this a bug? Example:
Copy code
{
  "dimensions": [
    {
      "type": "listFiltered",
      "delegate": "based_on",
      "values": [
        null,
        "A",
        "B"
      ]
    }
  ],
  "aggregations": [
    {
      "type": "doubleSum",
      "fieldName": "value",
      "name": "value"
    }
  ],
  "intervals": [
    "2025-01-01T00:00:00.000Z/2025-07-10T23:59:59.999Z"
  ],
  "queryType": "groupBy",
  "granularity": "all",
  "dataSource": "datasource_A"
}
will fail with
Copy code
Error: RUNTIME_FAILURE (OPERATOR)

Cannot invoke "String.getBytes(String)" because "string" is null

java.lang.NullPointerException
The line in question is this. Passing in empty string in-place of the
NULL
returns null values, so this is a partial work-around for now.
g
Seems like two bugs to me
It should accept
null
, and if an empty string is passed in, it shouldn't be allowing
null
vals in the response
Does it still do that after the version in which we removed
druid.generic.useDefaultValueForNull
?
All the
null
/ empty string conflation stuff should have been removed at that time
This is running v33
g
Hmm. The NPE is in
getCacheKey
, that seems like an oversight that should be easy to fix by switching it to using
CacheKeyBuilder
"Passing in empty string in-place of the NULL returns null values" seems like a bug too, although I don't see at a quick glance what might be causing that. I would not suggest relying on that behavior since it may be fixed in the future