To analyze data from a data source, files must be formatted into physical datasets in Dremio Cloud. You can then create virtual datasets from one or more physical datasets. The following figure shows how data is represented in Dremio Cloud.
A physical dataset (PDS) is a table representation of the data in your source. A PDS cannot be modified by Dremio Cloud. A PDS is represented by the icon .
A virtual dataset (VDS) is a view derived from physical datasets or other virtual datasets.
Virtual datasets are not copies of the data so they use very little memory and always reflect the current state of the parent datasets they are derived from. A VDS is represented by the icon .
Dremio recommends that, when you create datasets, you create them in layers:
- The bottom or first layer consists of your physical datasets.
- In the second layer are virtual datasets, one for each physical dataset, that do lightweight preparation of data for virtual datasets in the next layers. Here, administrators might create virtual datasets 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 virtual datasets to build higher-order virtual datasets that data consumers can use. Then, admins grant access to these virtual datasets to users who create virtual datasets in the next layer, without being able to see the raw data in the physical datasets.
- In the third layer, users create virtual datasets 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 virtual datasets.
- In the fourth layer, users can create lightweight virtual datasets for dashboards, reports, and visualization tools. They can also create aggregation reflections, as needed.
The following section describes how to create and manage datasets.
Formatting a Physical Dataset
For formatting a file or folder as a physical dataset, see formatting datasets.
Viewing a Physical Dataset
To view a physical dataset:
In the Datasets UI, navigate to a data source.
If you have already formatted your dataset, then select that dataset. Otherwise, you can format a file or folder as a PDS.
The dataset page displays the table fields of the PDS.
To see the metadata of a PDS, click the PDS icon that is on the top-left of the page.
The metadata fields of a PDS are described below.
Metadata Field Description Descendants The number of virtual datasets that are created from this physical dataset. Fields Columns of the table in the physical dataset. Field types are also displayed. Columns with partitions (if any) have a separate partition icon and field types, dir0, dir1, dir2 as shown in the above figure. Jobs The number of jobs run on the PDS.
Creating a Virtual Dataset
You can create a VDS from an existing PDS or VDS. Create a VDS from a PDS by performing the following steps:
To create a VDS from a PDS, you can transform the data as required.
Compose the query as required and click Run to validate the query. After running the query, click the Save icon in the top-right corner of the page. In the drop-down list, click Save As….
As physical datasets cannot be modified, Save is disabled in the drop-down list.
Clicking Save As… prompts you to name the new virtual dataset 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 VDS gets saved in your home space.
To see the new VDS, navigate to the space that contains the VDS on the Datasets page. Click the VDS to see the data.
You can edit the original query that created the VDS. Click the Edit Original Query button on top of the query editor. You can edit the query and click the Save icon, and then click Save in the drop-down list.
You can also create a new VDS after editing the original query by clicking the Save icon and then clicking Save As…. Save it as a new VDS by providing a name.
Example of Creating a VDS
This example shows how to create a VDS from the SF weather 2018-2019.csv PDS by performing the following steps:
In the Datasets UI, trace the SF weather 2018-2019.csv PDS in the corresponding source folder and click it. To create a VDS, change the data type of the ELEVATION into number by running the following query.
SELECT TO_NUMBER(ELEVATION, '##.##') AS ELEVATION FROM "SF weather 2018-2019.csv"
Click the Save icon in the top-right corner of the page, and then click Save As… from the drop-down list. As physical datasets cannot be modified, Save is disabled in the drop-down list.
Clicking Save As… prompts you to name the new virtual dataset 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 VDS as SFWeatherElevation. If you do not specify a space (path), the VDS is saved in your home space.
On the Datasets page, navigate to the space that contains the SFWeatherElevation VDS. Click the VDS to see the query and data. You can see the table with a single Elevation column and the following query.
SELECT * FROM SFWeatherElevation
Exploring the Dataset Components
Catalog lets you add useful information about a specific dataset in its wiki, and add searchable tags. This enhances team collaboration as other users can search the tags to trace a specific dataset.
The graph shows the data lineage of a dataset. Data lineage refers to the record of how data got into a specific location and the intermediate steps and transformations that took place in its transit.
Dremio Cloud maintains physically optimized representations of source data known as data reflections.
Starring a Dataset
You can star a dataset that you use frequently, which adds the dataset to your Starred list for easier access.
To star a dataset:
- Click on the icon in the side navigation bar to navigate to the SQL Runner.
- In the Data catalog, find the dataset.
- Click on the (Star) icon that appears next to the dataset. The dataset will appear on your Starred list.
In addition to starring datasets, 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.
- The starring option is not available for datasets in the Nessie repository.
- Starring is different than pinning items. You can only pin spaces and sources in the Datasets UI, and pinned items are not saved if you open a new browser or clear the cache.
Removing a Physical Dataset
Removing the format removes a physical dataset.
Removing a Virtual Dataset
Perform the following steps to remove a VDS:
In the Datasets UI, go to the home space (home icon) or any space under Spaces, where your VDS is located.
Under the Action column of a VDS that you want to remove, click the ellipses (…) icon. From the list of actions, click Remove. Confirm that you want to remove the VDS.
If you are removing a dataset with children, you get a warning. Removing a dataset with children leaves you with disconnected views that you can no longer query.