In a SQL query you can choose your data return format, which columns to return, and in what order, by modifying your query. You can reorder, hide, and format data, and display up to 64k rows. This article describes how to control data presentation in table visualizations.
After running a query, in the Results panel, click the drop-down icon next to Results and then select Edit. The visualization editor displays:
Reorder columns by dragging them up or down using the handle.
Hide columns by toggling the icon.
Format columns using the format settings.
Databricks SQL allows you to format some common data types –text, numbers, dates, and Booleans–and has support for non-standard column types like images, JSON documents, and links. To display type-specific formatting options, select the type in the Display as field.
Configure the font colors for column results to a static color or a range of colors based on comparing the column value to a threshold.
Edit the visualization.
Optionally, set the default font color to a non-default value.
Under Font Conditions, click + Add condition.
Select the column, the threshold, the comparator, and the font color if the comparison succeeds.
The threshold can be a numeric type, string, or date. For the comparison to succeed, the threshold must be the same data type as the column. For example, to colorize results whose values exceed the numeric value
500000, create the threshold
> 500000, rather than
> 500,000. Numeric types, strings, and dates are supported.
Optionally add more conditions.
If a query result does not provide type information, Databricks SQL renders a column as text. You can force it to use arbitrary types. For example, you can:
Display floats out to three decimal places.
Show only the month and year of a date column.
Prepend or append text to your number fields.
The Allow HTML content field has the following behavior:
Enabled: HTML content is run through an HTML sanitizer and the column is rendered as HTML.
Disabled: The content is displayed without rendering the HTML.
Databricks SQL supports the following special data types: image, JSON, and link.
If a field in your database contains links to images, select Image to display the images inline with your table results. This is useful for dashboards. In the following dashboard, the Customer Image field is a link to an image that Databricks SQL displays in-place.