Presto 8.8 — Tutorial

Mastering Presto 8.8: A Comprehensive Tutorial for High-Performance Data Queries

Prerequisites

Step 5: Configure Presto Properties

Create etc/config.properties (coordinator + worker on same machine):

coordinator=true
node-scheduler.include-coordinator=true
http-server.http.port=8080
discovery.uri=http://localhost:8080
query.max-memory=3GB
query.max-memory-per-node=1GB
query.max-total-memory-per-node=2GB

1. Hive Connector (for S3 or HDFS)

Create etc/catalog/hive.properties:

connector.name=hive-hadoop2
hive.metastore.uri=thrift://localhost:9083
hive.allow-drop-table=true
hive.s3.aws-access-key=YOUR_ACCESS_KEY
hive.s3.aws-secret-key=YOUR_SECRET_KEY

4.3. Working with Nested Data (JSON maps)

Presto 8.8 improves json_extract and transform functions: tutorial presto 8.8

WITH data AS (
  SELECT JSON_PARSE('"name": "Alice", "scores": [95, 87, 92]') AS doc
)
SELECT 
  json_extract_scalar(doc, '$.name') AS name,
  transform(cast(json_extract(doc, '$.scores') AS array(integer)), x -> x + 1) AS adjusted_scores
FROM data;