Running queries from Playground
.The Playground lets you retrieve and analyze specific data by writing and running SQL queries on your connected data sources.
To run queries in Playground, do the following:
-
On the Home page, from the left navigation panel, click Playground and create a query or click the Query tab and select an existing query.
-
Select a query engine. Before executing, you can choose one of the following providers:
-
Spark
-
Athena (Only for data warehouses)
infoThe Athena query engine is exclusively compatible with AWS data sources within DataGOL. These AWS sources include data warehouses, folders configured as data sources, and S3 buckets serving as files.
For querying data residing in these specific data sources, the Athena query engine is the recommended choice. Furthermore, for scenarios involving high data volumes, Athena can offer faster query execution, although it's important to note that this increased speed may come with higher costs.
-
JDBC (Only for PostgreSQL and single data source)
-
-
Selecting the appropriate provider can optimize query execution, especially for large datasets. With Spark data provider along with the copy option, a Last Mile pipeline will be created when the storage type is switched from S3 to DB. The Last Mile pipeline provides the visibility on the storage type conversion process to the user.
-
Click the Run button above the query editory to execute your SQL query against the selected data source. After the query execution is completed, the results will be displayed.
-
Click Run button above the query. The query is run and the results are displayed. Also, you can highlight a query or part of a query in the editor to run just the selected portion
When a data source has a specific schema name and you are querying the database directly in a playground environment, the query format for referencing objects within that schema must be used as follows:
SELECT * FROM <datasource>.<schema>.<table> LIMIT 10
-
<datasource>
: Replace this with the name of the data source. -
<schema_name>
: Replace this with the actual name of the schema where the table resides. Schemas organize database objects and act as namespaces. -
<table_name>
: Replace this with the actual name of the table you want to query. -
LIMIT 10
: This is an optional clause that restricts the number of rows returned to 10. It is good practice in a playground to prevent large results from slowing things down. You can adjust this number or remove it if you need more (or all) rows.
Was this helpful?