cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

Multi-select dashboard parameter now resolves to NULL instead of empty array?

DwarkaPandey
Visitor

Hi everyone,

We're seeing a change in the behavior of multi-select dashboard parameters in Databricks SQL dashboards.

Previously, when no value was selected in a multi-select filter, our query logic worked as expected using:

SIZE(:my_parameter) = 0

However, starting recently, the same dashboards no longer behave as expected on the initial page load. It appears that the parameter is now resolving to NULL instead of an empty array ([]).

This has affected multiple dashboards that were previously working without any changes.

Has anyone else experienced this behavior?

Specifically:

 

Has there been a recent change in how Databricks SQL or Lakeview Dashboards initialize unset multi-select parameters?

Is this expected behavior or a known issue?

What is the recommended way to handle an unselected multi-select parameter now?

We're currently using logic similar to:

WHERE SIZE(:my_parameter) = 0

OR column_name IN (:my_parameter)

Any guidance or recommended workaround would be appreciated.

Thanks!

1 REPLY 1

balajij8
Esteemed Contributor

The platform is aligning with standard SQL semantics (IS NULL etc) and you can follow it. To fix the queries returning zero rows on load, you need to explicitly evaluate for NULL before passing the parameter to any array-specific functions or IN clauses.

You can follow pattern given below instead

WHERE :my_parameter IS NULL 
   OR column_name IN (:my_parameter)

If you are applying this across multiple multi-select filters, ensure you wrap each condition in parentheses, so the OR conditions don't interfere with AND operators.

WHERE (:category IS NULL OR category_column IN (:category))
  AND (:region IS NULL OR region_column IN (:region))
  AND (:status IS NULL OR status_column IN (:status))

For a highly resilient approach, you can safely combine both checks in case the parameter occasionally resolves to an empty array depending on how a user interacts with the widget during a session.

WHERE :my_parameter IS NULL 
   OR SIZE(:my_parameter) = 0 
   OR column_name IN (:my_parameter)