Questions tagged [trino]

Trino is an open source distributed SQL query engine for running analytic queries against data sources of all sizes ranging from gigabytes to petabytes. Trino is the community version of Presto, and emerged from the rename of the PrestoSQL codebase.

What is Trino?

Trino is an open source distributed SQL query engine for running interactive analytic queries against data sources of all sizes ranging from gigabytes to petabytes.

Trino, formerly Presto, was designed and written from the ground up for interactive analytics and approaches the speed of commercial data warehouses while scaling to the size of very large organizations.

What can it do?

Trino allows querying data where it lives, including HDFS/Hive, object storage systems like S3, Iceberg, Delta Lake, many relational databases, NoSQL/document databases, and even proprietary data stores. A single Trino query, written in standard SQL, can combine data from multiple sources, allowing for analytics across your entire organization.

Trino is targeted at analysts who expect response times ranging from sub-second to minutes. Trino breaks the false choice between having fast analytics using an expensive commercial solution or using a slow "free" solution that requires excessive hardware.

The massively parallel processing design of Trino allows very high performance, and horizontal scaling to adjust to your needs.

References

680 questions
58
votes
2 answers

Presto/Trino - static date and timestamp in where clause

I'm pretty sure the following query used to work for me on Presto: select segment, sum(count) from modeling_trends where segment='2557172' and date = '2016-06-23' and count_time between '2016-06-23 14:00:00.000' and '2016-06-23 14:59:59.000'; group…
Tal Joffe
  • 5,347
  • 4
  • 25
  • 31
42
votes
3 answers

Presto equivalent of MySQL group_concat

I'm new to Presto and looking to get the same functionality as the group_concat function in MySQL. Are the following two equivalent? If not, any suggestions for how I can recreate the group_concat functionality in Presto? MySQL: select a, …
Mike Moyer
  • 431
  • 1
  • 4
  • 4
23
votes
2 answers

LATERAL VIEW EXPLODE in presto

New to presto, any pointer how can I use LATERAL VIEW EXPLODE in presto for below table. I need to filter on names in my presto query CREATE EXTERNAL TABLE `id`( `id` string, `names` map>, `tags`…
rkj
  • 671
  • 3
  • 14
  • 25
21
votes
4 answers

Presto array contains an element that likes some pattern

For example, one column in my table is an array, I want to check if that column contains an element that contains substring "denied" (so elements like "denied at 12:00 pm", "denied by admin" will all count, I believe I will have to use "like" to…
daydayup
  • 2,049
  • 5
  • 22
  • 47
17
votes
2 answers

Checking if key exists in Presto value map

I am new to Presto, and can't quite figure out how to check if a key is present in a map. When I run a SELECT query, this error message is returned: Key not present in map: element SELECT value_map['element'] FROM mytable WHERE name =…
iskandarblue
  • 7,208
  • 15
  • 60
  • 130
15
votes
1 answer

Difference between "ROWS BETWEEN" and "RANGE BETWEEN" in (Presto) window function "OVER" clause

This question is primarily about older versions of PrestoSQL, which have been resolved in the (now renamed) Trino project as of versions 346. However, Amazon's Athena project is based off of Presto versions 0.217 (Athena Engine 2) and 0.172 (Athena…
mbafford
  • 2,266
  • 1
  • 20
  • 25
15
votes
1 answer

Finding out the data type of a value in Presto

I'm getting values from nested maps and it's hard to figure out what data type each value is. Is there a typeof function that can tell me the data type of each value?
Leo Jiang
  • 24,497
  • 49
  • 154
  • 284
13
votes
2 answers

Combine rows into a list in PrestoSQL

Currently, my table has three different fields, id1, id2 and actions. action is of type string. For example, my table looks something like the table given below: id1 | id2 | actions --------------------------- "a1" "a2" …
Telepresence
  • 619
  • 2
  • 7
  • 22
13
votes
2 answers

How to configure Presto searches to be case-insensitive?

In my case, Presto connects to a MySQL database which has been configured to be case-insensitive. But any search through Presto seems to be case-sensitive. Questions: 1) Is there a way to configure Presto searches to be case-insensitive? If not, can…
felarof99
  • 185
  • 1
  • 1
  • 9
12
votes
3 answers

How to concatenate arrays grouped by another column in Presto?

Is this possible in SQL (preferably Presto): I want to reshape this table: id, array 1, ['something'] 1, ['something else'] 2, ['something'] To this table: id, array 1, ['something', 'something else'] 2, ['something']
bry888
  • 263
  • 1
  • 4
  • 13
12
votes
2 answers

How to convert timestamp to date in Presto?

I like to convert my timestamp columns to date and time format. How should I write the query from presto? my timestamp is UTC time. Thank you very much Timestamp format"1506929478589" After query convert it looks like "2016-10-25 21:04:08.436"
user8818601
  • 123
  • 1
  • 1
  • 6
10
votes
1 answer

How to convert varchar to array in Presto Athena

My data is in VARCHAR format. I want to split both the elements of this array so that I can then extract a key value from the JSON. Data format [ { "skuId": "5bc87ae20d298a283c297ca1", "unitPrice": 0, "id": "5bc87ae20d298a283c297ca1", …
dhankhar
  • 101
  • 1
  • 1
  • 5
9
votes
1 answer

Hardware requirements for Presto

I suspect the answer is "it depends", but is there any general guidance about what kind of hardware to plan to use for Presto? Since Presto uses a coordinator and a set of workers, and workers run with the data, I imagine the main issues will be…
benvolioT
  • 4,507
  • 2
  • 36
  • 30
7
votes
2 answers

Presto Produce JSON results

I have a json table which was created by CREATE TABLE `normaldata_source`( `column1` int, `column2` string, `column3` struct) A sample data is: { "column1": 9, "column2": "Z", "column3": { "column4": "Y" } } If…
lclankyo
  • 221
  • 3
  • 10
7
votes
3 answers

Presto query: Find the key with maximum value in a map

I have a table Name pets -------------- Andy {dog:2, cat:1, bird:4} John {tiger:3, elephant:1, fish:2} Mary {dog:2, pig:2} I want the find the pet type with maximum count for each person. In the event of tie, duplicate the row for each pet. The…
Edamame
  • 23,718
  • 73
  • 186
  • 320
1
2 3
45 46