Redshift 입문
Jason Myers
Principal Architect
데이터베이스 구성 요소

Redshift Spectrum

| File format | Columnar | Supports parallel reads |
|---|---|---|
| Parquet | Yes | Yes |
| ORC | Yes | Yes |
| TextFile | No | No |
| OpenCSV | No | Yes |
| JSON | No | No |
CREATE TABLE spectrumdb.IDAHO_SITE_ID ( 'pk_siteid' INTEGER PRIMARY KEY, -- Cutting the rest of columns for space )-- CSV rows are comma delimited ROW FORMAT DELIMITED-- CSV fields are terminated by a comma FIELDS TERMINATED BY ','-- CSVs are a type of text file STORED AS TEXTFILE-- This is where the data is in AWS S3 LOCATION 's3://spectrum-id/idaho_sites/'-- This file has headers that we want to skip TABLE PROPERTIES ('skip.header.line.count'='1');
EXPLAIN은 다르게 표시됨DISTKEY나 SORTKEY는 고려 대상 아님$path - 행의 파일 경로$size - 행의 파일 크기SELECT "$path",
"$size",
pk_siteid
FROM spectrumdb.idaho_site_id;
$path | $size | pk_siteid
================================|=======|==========
's3://spectrum-id/idaho_sites/' | 1616 | 1
's3://spectrum-id/idaho_sites/' | 1616 | 2
's3://spectrum-id/idaho_sites/' | 1616 | 3
일반 형식:
읽기 전용
internal 또는 externalSELECT schema_name,
schema_type
FROM SVV_ALL_SCHEMAS
ORDER BY SCHEMA_NAME;
schema_name | schema_type
======================|=============
public_intro_redshift | internal
spectrumdb | external
TABLE 또는 EXTERNAL TABLESELECT table_name,
table_type
FROM SVV_ALL_TABLES
WHERE schema_name = 'public_intro_redshift';
table_name | table_type
==========================|================
coffee_county_weather | TABLE
idaho_monitoring_location | TABLE
idaho_samples | TABLE
ecommerce_sales | EXTERNAL_TABLE
Redshift 입문