Using SQL #
Starburst Enterprise and Starburst Galaxy are built on Trino. Trino’s open source distributed SQL engine runs fast analytic queries against various data sources ranging in size from gigabytes to petabytes. Data sources are exposed as catalogs. Because Trino’s SQL is ANSI-compliant and supports most of the SQL language features you depend on, you can hit the ground running.
Business intelligence users and data scientists can continue to use their favorite client tools such as Tableau, Qlik and Apache Superset to access and analyze virtually any data source, or multiple data sources in a single query.
General SQL features #
We know you want to jump right in, and we know you already have awesome analytics skills. It’s just a matter of harnessing the power of SQL to take your analytics even further:
Just in case you’d like a more structured walkthrough, here are of some specifically interesting SQL features in Starburst, presented by one of our founders, David Phillips:
- Formatting
- CASE and searched CASE expressions
- IF expressions
- TRY expressions
- Lambda expressions
Running time: ~8 min.
Advanced SQL #
Ready to move past the basics? For your convenience, we’ve divided the Advanced SQL for Starburst video training course up into topic sections, and provided links to the relevant parts of our documentation below.
Advanced aggregation techniques #
- count() with DISTINCT
- Approximations, including counting and percentiles
- max_by() values
- Pivoting with count_if() and FILTER
- Complex aggregations
- Checksums
- ROLLUP
- CUBE
- GROUPING SETS
Running time: ~28 min.
Window functions #
- Row numbering
- Ranking
- Ranking and numbering without ordering
- Bucketing and percentage ranking
- Partitioning
- Accessing leading and training rows with lead() and lag()
- Window frames
- Accessing first, last and Nth values
- ROWS vs RANGE using array_agg()
- Using aggregations in window functions
Running time: ~25 min.
Array and map functions #
Many data stores allow to to create arrays, but it isn’t always easy. Starburst allows you to easily create arrays and maps with your data. Creating arrays with your data is easy:
SELECT ARRAY[4, 5, 6] AS integers,
ARRAY['hello', 'world'] AS varchars;
integers | varchars
-----------+----------------
[4, 5, 6] | [hello, world]
SQL array indexes are 1-based. Learn more about how to use and manipulate them in this in-depth video.
- Accessing array and map elements with element_at()
- Sorting arrays with array_sort()
- matching elements with any_match(), all_match() and none_match()
- Filtering elements
- Transforming elements
- Converting arrays to strings
- Computing array products
- Unnesting arrays and maps
- Creating maps from keys and values and an array of entry rows
Running time: ~19 min.
Using JSON #
- The JSON data type
- Extraction using json_extract() and json_extract_scalar()
- Casting and partial casting from JSON
- Formatting as JSON
Running time: ~14 min.
Is the information on this page helpful?
Yes
No
Is the information on this page helpful?
Yes
No