# Empty variables when using databricks datsource

**URL:** <https://community.grafana.com/t/empty-variables-when-using-databricks-datsource/68157>\
**Category:** Dashboards\
**Created:** [July 4, 2022, 11:13am UTC](https://community.grafana.com/t/empty-variables-when-using-databricks-datsource/68157 "2022-07-04T11:13:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![eparmannfirstgrafana](https://avatars.discourse-cdn.com/v4/letter/e/f07891/32.png) [@eparmannfirstgrafana](https://community.grafana.com/u/eparmannfirstgrafana)\
**Post date:** [July 4, 2022, 11:13am UTC](https://community.grafana.com/t/empty-variables-when-using-databricks-datsource/68157/1 "2022-07-04T11:13:19Z")

</div>

I am on grafana cloud, which at the moment is at v9.0.3

I am testing out the new databricks datasource (good work btw), and I want to use a query to populate a dashboard variable. I am adding the variable with “Databricks” as the datasource, and the query is

> SELECT DISTINCT `variable` FROM `hive_metastore`.`mydb`.`mytable`

Unfortunately, the only thing under “Preview of values” is “None”. Also, when I go to query history in databricks I see that **no query** has been sendt to it.

But if I execute the exact same query in “explore” for the datasource I get back a table with a single column “variable” containing 10 rows.

There are no errors reported anywhere, I just dont see any sign of the query ever beeing executed.

---

<div class="post-metadata">

**Author:** ![yosiasz](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/yosiasz/32/45847_2.png) [@yosiasz](https://community.grafana.com/u/yosiasz)\
**Post date:** [July 4, 2022, 3:10pm UTC](https://community.grafana.com/t/empty-variables-when-using-databricks-datsource/68157/2 "2022-07-04T15:10:53Z")

</div>

so the table mytable contains a column named variable?

---

<div class="post-metadata">

**Author:** ![eparmannfirstgrafana](https://avatars.discourse-cdn.com/v4/letter/e/f07891/32.png) [@eparmannfirstgrafana](https://community.grafana.com/u/eparmannfirstgrafana)\
**Post date:** [July 4, 2022, 6:03pm UTC](https://community.grafana.com/t/empty-variables-when-using-databricks-datsource/68157/3 "2022-07-04T18:03:39Z")

</div>

yes, thats correct. It is on “long” format with timestamp, variable and value, and I want to extract out the variable’s so they can be used in the filteres.

---

<div class="post-metadata">

**Author:** ![yosiasz](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/yosiasz/32/45847_2.png) [@yosiasz](https://community.grafana.com/u/yosiasz)\
**Post date:** [July 5, 2022, 5:37am UTC](https://community.grafana.com/t/empty-variables-when-using-databricks-datsource/68157/4 "2022-07-05T05:37:52Z")

</div>

please show us the query that use this variable?

---

<div class="post-metadata">

**Author:** ![eparmannfirstgrafana](https://avatars.discourse-cdn.com/v4/letter/e/f07891/32.png) [@eparmannfirstgrafana](https://community.grafana.com/u/eparmannfirstgrafana)\
**Post date:** [July 5, 2022, 8:24am UTC](https://community.grafana.com/t/empty-variables-when-using-databricks-datsource/68157/5 "2022-07-05T08:24:38Z")

</div>

So, here is how it looks like when I try to add the variable. Notice how “Preview of values” contains None

 ![bilde](https://us1.discourse-cdn.com/grafana/original/3X/0/9/09a66ce689438faf9352e2a24d895847abe9cc9e.png)  
Here is how it looks like in the “explore”, showing that the query is correct and that the data-source is configured properly (its the same datasource).  
 ![bilde](https://us1.discourse-cdn.com/grafana/original/3X/4/d/4dbfc60830860568037471adb32ac953d314c5be.png)
