table_compression

用法

view: my_view {
  derived_table: {
    table_compression: GZIP
    ...
  }
}
层次结构
table_compression
默认值
GZIP

接受
GZIPSNAPPY

特殊规则
table_compression 仅在特定方言中受支持

定义

table_compression 参数用于指定 永久性派生表 (PDT) 在 Athena 数据库中的压缩方式,可以是 GZIPSNAPPY

如需了解详情,请参阅 Amazon Athena 文档

如需查看支持 table_compression 的方言列表,请参阅table_compression 的方言支持部分。

table_compression 参数仅适用于永久性表,例如 PDT 和汇总表。对于没有持久性策略的派生表,不支持 table_compression

示例

在采用 SNAPPY 压缩的 Amazon Athena 数据库上创建 customer_order_facts PDT:

view: customer_order_facts {
  derived_table: {
    explore_source: order {
      column: customer_id { field: order.customer_id }
      column: date { field: order.order_time }
      column: city { field: users.city }
      column: age_tier { field: users.age_tier }
      derived_column: num_orders {
        sql: COUNT(order.customer_id) ;;
      }
    }
    table_format: ORC
    table_compression: SNAPPY
    datagroup_trigger: daily_datagroup
  }
}

针对 table_compression 的方言支持

能否使用 table_compression 取决于 Looker 连接所使用的数据库方言。在最新版 Looker 中,以下方言支持 table_compression

方言 是否支持?
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 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