Introduzione a Redshift
Jason Myers
Principal Architect
Leader Node
Compute Node

-- Seleziona la sottostringa a partire
-- dalla posizione 11 di 'chocolate chip'
SELECT SUBSTR('chocolate chip', 11);
chip
SUBSTRINGSUBSTR genera errore su colonne di tabella-- Seleziona la sottostringa dalla posizione 1
-- della colonna chiamata field nella tabella
SELECT SUBSTR(field, 1) FROM table;
ERROR: SUBSTR() function is not
supported (Hint: use SUBSTRING
instead)
SELECT host,
-- Calculate the percentage of used space
-- using the used minus tossed or ready to be reclaimed
-- divided by the capacity
(used - tossed) / capacity * 100 as percent_used
FROM STV_PARTITIONS;
host | percent_used
======+==============
0 | 24.9
1 | 24.8
SELECT table_A.columnX,
table_B.columnY,
FROM table_A
INNER JOIN table_B
-- predicate
ON table_B.foreign_key = table_A.primary_key
-- predicate
WHERE table_B.columnZ = 'value';


Catalogo dei metadati
Query Engine
Storage
AWS Glue Data Catalog
Bucket AWS S3

Introduzione a Redshift