Skip to main content
Version: current [24.2.x]

Datasets

To analyze data from a data source, files must be formatted into tables in Dremio. You can then create views from one or more tables. The following figure shows how data is represented in Dremio.

Tables

A table contains the data from your source, formatted as rows and columns. A table cannot be modified by Dremio.

Tables created from a folder of files display as a folder , whereas tables created from a single file are represented by a grid .

Views

A view is a view derived from tables or other views. Views are defined by the steps necessary for their creation, including transformations, filters, joins, and other modifications.

Views are not copies of the data so they use very little memory and always reflect the current state of the parent tables or views they are derived from. A view is represented by .

note

Let's imagine a dataset is represented as a sales table. We can open this dataset within Dremio, and save it as a view called salesRaw. Later on we can derive another view called salesNY from salesRaw by excluding all data that doesn't originate from the state of New York. salesRaw and salesNY can each be queried and will return different results, but they are both based on the same underlying table.

Viewing a Table

To view a table:

  1. On the Datasets page, navigate to a data source.

  2. If you have already formatted your table, then select that table. Otherwise, you can format a file or folder as a table.

  3. Click Run or Preview to query the dataset. The Data tab displays the table fields.

Viewing the Metadata of a Dataset

Wherever a dataset is referenced in Dremio, you can view a metadata card with details about the dataset.

To view the metadata, hover over a dataset to see a metadata card appear with details about the dataset. The components of the metadata card are described below.

This screenshot is displaying the metadata card.
LocationDescription
1Icon represents the dataset format as a table or a view .
2Card title displays the dataset name.
3 will appear if the dataset has a reflection.
4Click to query the dataset.
5Depends on whether the dataset is a view or a table. For views, click to edit the dataset. For tables, click to go to the table.
6The path where the dataset is located.
7Displays any labels that have been applied to the dataset.
8Jobs: The number of jobs run on the dataset in the last 30 days, which links to the Jobs page.
9Descendants: The number of views that are created from the dataset.
10The date and time when the dataset was created.
11The user who owns the dataset.
12The date and time when the dataset was last updated.
13Launch a BI tool to analyze your data.
14Details Panel: Click this link to open the panel on the right side of the browser window. In the Details Panel, you can add or remove labels on the dataset and add or modify wiki content.
15Lineage: Click this link to open the data lineage in a new tab. Lineage records how data got into the specific location and the intermediate steps and transformations that took place in its transit.
16Columns: The number of columns in the dataset, including the name and data type of each column. Columns with partitions (if any) use a separate partition icon.
note

When viewing a metadata card in the SQL Runner's data panel, the Columns section at the bottom of the card is not displayed because columns can be displayed by expanding the dataset.

Formatting a Table

For formatting a file or folder as a table, see formatting tables and views.

Creating a View

You can create a view from an existing table or view by performing the following steps:

  1. To create a view from a table, you can transform the data as required.

  2. Compose the query as required and click Run to validate the query. After running the query, click the arrow next to Save Script As in the top right of the SQL editor, and select Save View as... from the drop-down menu.

  3. Clicking Save View as... prompts you to name the new view and select from a list of spaces where it will be stored. Provide a name and select one space to store it. If the space (path) is not changed, the view gets saved in your home space.

  4. To see the new view, navigate to the space that contains the view on the Datasets page. Click the view to see the data.

Example of Creating a View

This example shows how to create a view from the SF weather 2018-2019.csv table by performing the following steps:

  1. On the Datasets page, trace the SF weather 2018-2019.csv table in the corresponding source folder and click it. To create a view, change the data type of the ELEVATION into a number by running the following query.
Query to change ELEVATION data type
SELECT TO_NUMBER(ELEVATION, '##.##') AS ELEVATION FROM "SF weather 2018-2019.csv"
  1. Click the arrow next to Save Script As in the top right of the SQL editor, and select Save View as... from the drop-down menu.
  2. Clicking Save View as... prompts you to name the new view and select from a list of spaces where it will be stored. Provide a name and select a space to store it. Let us name the view as SFWeatherElevation. If you do not specify a space (path), the view is saved in your home space.
  3. On the Datasets page, navigate to the space that contains the SFWeatherElevation view. Click the view to see the query and data. You can see the table with a single Elevation column and the following query.
Query for SFWeatherElevation
SELECT * FROM SFWeatherElevation

Layering Tables and Views

Dremio recommends that, when you create tables and views, you create them in layers:

  • The bottom or first layer consists of your tables.
  • In the second layer are views, one for each table, that do lightweight preparation of data for views in the next layers. Here, administrators might create views that do limited casting, type conversion, and field renaming, and redacting sensitive information, among other prepping operations. Administrators can also add security by subsetting both rows and fields that users in other layers are not allowed to access. The data has been lightly scrubbed and restricted to the group of people who have the business knowledge that lets them use these views to build higher-order views that data consumers can use. Then, admins grant access to these views to users who create views in the next layer, without being able to see the raw data in the tables.
  • In the third layer, users create views that perform joins and other expensive operations. This layer is where the intensive work on data is performed. These users then create reflections (raw, aggregation, or both) from their views.
  • In the fourth layer, users can create lightweight views for dashboards, reports, and visualization tools. They can also create aggregation reflections, as needed.

Editing Datasets

On the Datasets page, you can click directly on a dataset to edit, and the available edit options depend on whether the dataset is a view or a table.

note

If you would rather click directly on a dataset to query it, see Preferences for modifying this setting.

For views, you can view or edit the DDL (or original SQL) statement that was used for the dataset. The SQL editor will pre-populate the DDL statement as long as you have privilege access for the dataset.

For tables, you view the metadata and edit the definition of the dataset, because tables cannot be modified. If you want to make edits to a table, you will need to save it as a view.

If you are viewing a table or you don't have privilege access for the dataset, the default SELECT * FROM <name of your dataset> statement will be pre-populated instead, as shown in this image:

This screenshot is displaying the SQL editor within the Datasets page.
LocationDescription
1The title displays the name of the open dataset.
2The Data panel is used to explore your data catalog.
3Collapsing the Data panel hides the panel from view.
4The Data tab on the Datasets page opens the SQL editor.
5Because this is a table, the default SELECT statement is pre-populated in the SQL editor.
6Dataset settings opens a dialog for editing the format, reflections, reflection refresh, and privileges of the dataset.
7Options for saving your SQL statement are in the top-right corner of the SQL editor.
note

When editing a dataset, a preview of the results will not render by default. The results will only load if you explicitly click Run or Preview.

Exploring Datasets

When viewing or editing a dataset, you are directed to the Data tab by default. For more options, check out the other tabs on the Datasets page:

This is a screenshot showing the Datasets page.
LocationDescription
1Details shows the columns in a dataset and lets you add information about a specific dataset in its wiki. You can add searchable labels, which enhances team collaboration because other users can search the labels to trace a specific dataset.
2Lineage is a graph of the dataset, showing its data source, parent datasets, and children datasets.
3Reflections are physically optimized representations of source data.

Lineage

Lineage provides a graph of a dataset with its parent and child datasets.

On the Lineage tab, click to refocus the graph of the dataset at any time. You can also see parent datasets and data sources on the left with child datasets on the right, as shown in this image:

This is a screenshot showing the Lineage tab.

Chaining Datasets

There are a few considerations when chaining datasets:

  • If a column that is used in the child dataset (either direct column reference or select *) is dropped from the parent dataset, the child dataset must be updated. It is invalid until this is corrected.
  • If a column is added to a parent dataset, it does not show up in the child dataset (even when using select *) until it is updated.

Starring a Table or View

You can star a table or view that you use frequently, which adds the table or view to your Starred list for easier access.

To star a table or view:

  1. Click on the This is the icon that represents the SQL runner. icon in the side navigation bar to navigate to the SQL Runner.
  2. In the Data panel, find the dataset.
  3. Click on the This is the icon for starring a dataset. icon that appears next to the dataset. The dataset will appear on your Starred list.This is a screenshot showing how to star a table or view for the Starred list.In addition to starring tables and views, you can star spaces, sources, and other objects in the data catalog. The **Starred** list can hold up to 25 entities at a time, and each starred item remains on the list even if you open a new browser or clear the cache. To unstar a catalog object, click the Star icon again.
note
  • The starring option is not available for datasets in the Nessie repository.
  • Starring is different from pinning items. You can only pin spaces and sources on the Datasets page, and pinned items are not saved if you open a new browser or clear the cache.

Removing a Table

Removing the formatting on a table will revert the table to the folder or file format that it was originally in. For the steps, see Removing Formatting on Data.

Removing a View

Perform the following steps to remove a view:

  1. On the Datasets page, go to the Home Space This is the icon that represents the home space. icon or any space under Spaces, where your view is located.

  2. Under the Action column of a view that you want to remove, click the ellipses (...) icon. From the list of actions, click Remove. Confirm that you want to remove the view.

caution

If you are removing a table or view with children, you get a warning. Removing a table or view with children leaves you with disconnected views that you can no longer query.