I would like to run a cell in SQL and then include a markdown cells that includes the cell output.
SQL cell : select count(*) from table
1500
1 row returned
Expected Output: Markdown cell : Row count of the table is 1500
I would like to run a cell in SQL and then include a markdown cells that includes the cell output.
SQL cell : select count(*) from table
1500
1 row returned
Expected Output: Markdown cell : Row count of the table is 1500
Copyright © 2021 Jogjafile Inc.
As per this ask, currently markdown cells don't support variables, or we can't pass any cell's output dynamically to the markdown cell. It's still a feature request.
As an alternative, you can try the below workaround where a python cell is used to generate the expected markdown result.
Give your SQL count code in the
spark.sql()and get the required markdown like below.NOTE: If it doesn't work, make sure the Databricks runtime is latest. Here, my runtime is
13.3 LTS (includes Apache Spark 3.4.1, Scala 2.12)