distribution_style

사용

view: my_view {
  derived_table: {
    distribution_style: all
    ...
  }
}
계층 구조
distribution_style

- 또는 -

distribution_style
기본값
없음

허용
배포 스타일 (all 또는 even)
특수 규칙
distribution_style특정 언어에서만 지원됩니다

정의

distribution_style을 사용하면 영구 파생 테이블 (PDT) 또는 집계 테이블의 쿼리가 데이터베이스의 노드에 배포되는 방식을 지정할 수 있습니다.

distribution_style을 지원하는 언어 목록은 distribution_style의 언어 지원 섹션을 참고하세요.

distribution_style 매개변수는 PDT 및 집계 테이블과 같이 영구적인 테이블에서만 작동합니다. distribution_style은(는) 지속성 전략이 없는 파생 테이블에 지원되지 않습니다.

또한 distribution_style 매개변수는 create_process 또는 sql_create를 사용하여 정의된 파생 테이블에는 지원되지 않습니다.

마지막으로 distribution_styledistribution은 동시에 사용해서는 안 됩니다. 열 값을 기준으로 테이블의 행을 여러 Redshift 노드에 배포하려면 distribution을 사용합니다. 그렇지 않은 경우에는 distribution_style을 사용하여 다른 배포 전략을 선택합니다.

Redshift는 4가지 배포 스타일을 제공하며, 이는 배포 스타일에 관한 Amazon Redshift 문서에 설명되어 있습니다.

  • ALL 배포: 모든 행이 각 노드에 완전히 복사됩니다. Looker에서 distribution_style: all을 사용하여 이 유형의 배포를 수행할 수 있습니다.
  • EVEN 배포: 행이 라운드 로빈 방식으로 여러 노드에 배포됩니다. Looker에서 distribution_style: even을 사용하여 이 유형의 배포를 수행할 수 있습니다.
  • KEY 배포: 행이 특정 열 내의 고유한 값을 기준으로 여러 노드에 배포됩니다. Looker에서 distribution 매개변수를 사용하여 이 유형의 배포를 수행할 수 있습니다.
  • AUTO 배포 Redshift는 테이블 데이터의 크기를 기준으로 최적의 배포 스타일을 할당합니다. Looker는 이 배포 유형을 지원하지 않습니다.

적절한 배포 전략을 선택하려면 배포 스타일에 관한 Amazon Redshift 문서를 참고하세요. distribution_style을 지정하지 않고 대신 distribution 매개변수를 사용하지 않으면 Looker는 기본적으로 all을 사용합니다.

예시

배포 스타일이 allcustomer_order_facts 파생 테이블을 만듭니다.

view: customer_order_facts {
  derived_table: {
    sql:
      SELECT
        customer_id,
        COUNT(*) AS lifetime_orders
      FROM
        order
      GROUP BY 1 ;;
    persist_for: "24 hours"
    distribution_style: all
  }
}

distribution_style의 언어 지원

distribution_style을 사용할 수 있는지 여부는 Looker 연결에서 사용하는 데이터베이스 언어에 따라 다릅니다. Looker의 최신 출시 버전에서는 다음 언어에서 distribution_style을 지원합니다.

언어 지원 여부
Actian Avalanche
Amazon Athena
Amazon Aurora MySQL
Amazon Redshift
Amazon Redshift 2.1+
Amazon Redshift Serverless 2.1+
Apache Druid
Apache Druid 0.13+
Apache Druid 0.18+
Apache Hive 2.3+
Apache Hive 3.1.2+
Apache Spark 3+
ClickHouse
Cloudera Impala 3.1+
Cloudera Impala 3.1+ with Native Driver
Cloudera Impala with Native Driver
DataVirtuality
Databricks
Denodo 7
Denodo 8 & 9
Dremio
Dremio 11+
Exasol
Google BigQuery Legacy SQL
Google BigQuery Standard SQL
Google Cloud AlloyDB for PostgreSQL
Google Cloud PostgreSQL
Google Cloud SQL
Google Spanner
Greenplum
HyperSQL
IBM Netezza
MariaDB
Microsoft Azure PostgreSQL
Microsoft Azure SQL Database
Microsoft Azure Synapse Analytics
Microsoft SQL Server 2008+
Microsoft SQL Server 2012+
Microsoft SQL Server 2016
Microsoft SQL Server 2017+
MongoBI
MySQL
MySQL 8.0.12+
Oracle
Oracle ADWC
PostgreSQL 9.5+
PostgreSQL pre-9.5
PrestoDB
PrestoSQL
SAP HANA
SAP HANA 2+
SingleStore
SingleStore 7+
Snowflake
Teradata
Trino
Vector
Vertica