In a SQL query you can choose your data return format, which columns to return, and in what order by modifying your query. Databricks SQL table visualizations also allow you to manually reorder, hide, and format data. This article describes how you can control data presentation in table visualizations.
Click the Edit Visualization button under the table view. 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 it has special 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.
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
- Zero-pad integers
- Prepend or append text to your number fields
The Allow HTML content field has the following behavior:
- Enabled: Unsafe HTML content from the column is removed 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 especially useful for dashboards. In the following dashboard, the Customer Image field is a link to an image that Databricks SQL displays in-place.