Tables

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:

Visualization editor

You can:

  • Reorder columns by dragging them up or down using the Column Handle handle
  • Hide columns by toggling the Visibility Icon icon
  • Format columns using the format settings

Format columns

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.

Common data types

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

Text

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.

Numeric and date-time

For reference information on formatting numeric and date and time data types, see:

Special data types

Databricks SQL supports the following special data types: image, JSON, and link.

Image

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.

Dashboard with images

JSON

If your data returns JSON formatted text, select JSON. This lets you collapse and expand elements in a clean format.