Creating a data product from a query

You can customize a view of data and generate data joins by creating a data product with a query. To create a data product with a query, you must create and define an SQL query asset in a project, and then add it to a data product. By using queries, data products can be reused more frequently as producers can edit the SQL query on the same data products to generate different views.

Required roles
Collaborator roles: Editor

Creating an SQL query

Create and define an SQL query as a data asset in a project. The query determines the contents of your data product.

  1. From the navigation menu, click Projects > View all projects.
  2. Open or create a project. Then, click New asset SQL: Create a dynamic view of data to add a query asset to the project.
  3. Enter a name, then select a connection and a parameter set. Adding a description and tag are optional.
  4. There are two ways to define a query:
    • Enter the SQL query directly in the Query tab.
    • Convert your text query to SQL in the Text to SQL tab.
      1. Select the assets you want to run your query on.
      2. Enter your text query. For example: “Get all transactions with payment type” or “Join conditions and patients, then take the first 100 rows.”
      3. Select a model and click Generate SQL.
      4. Copy the SQL query and paste it in the Query tab.
  5. Click Create to connect your query with the indicated data connection. You can verify that your query was validated successfully by locating it in your project's assets page.

Adding a query to a data product

  1. From the Data Product Hub homepage, click Create data product.
  2. Enter a name for the data product and click the Add from project tile.
  3. Click Select items and add your SQL asset. You can use the advanced filters to locate and add your query quickly from your list of data assets.
  4. Verify the connections of all assets. To verify a connection, click the connection status and complete the fields by providing credentials. Make sure that you use an appropriate set of credentials as these credentials are used to deliver the data product to consumers following a subscription.
  5. Click Create draft to confirm your data asset selection. When your draft is successfully created, a static visualization of your data product is generated and viewable by the consumer after publish.

Enhancing your query for Text-to-SQL

Running metadata enrichment and metadata import improves text-to-SQL performance by increasing query accuracy, reducing manual fixes, and making data easier to discover and interpret. These steps enhance prompts so queries are schema-aware and aligned with enterprise needs, while added context helps the system understand natural language queries and map out the correct data structures.

Metadata Enrichment

Metadata enrichment helps add important information and context to data assets, such as assigning business terms, checking data quality, and profiling the data. Such information provides data consumers valuable insight in to the data product contents and quality. To run metadata enrichment, see Enriching your data.

Metadata Import

Metadata import helps add existing asset metadata and lineage information into the text-to-SQL system. To run metadata import, see Importing metadata.

Next steps

After you create your data product draft, see Completing a data product to finish preparing your data product for publication.

Learn more

Creating a data product from a customizable query