## Usage

```
view: my_view {
  derived_table: {
    table_compression: GZIP
    ...
  }
}
```

|---|---|
| Hierarchy [View File](https://docs.cloud.google.com/looker/docs/2616/reference/param-view.md.txt) [`view`](https://docs.cloud.google.com/looker/docs/2616/reference/param-view-view.md.txt) [`derived_table`](https://docs.cloud.google.com/looker/docs/2616/reference/param-view-derived-table.md.txt) `table_compression` | Default Value `GZIP` <br /> Accepts `GZIP` or `SNAPPY` <br /> Special Rules `table_compression` is supported only on [specific dialects](https://docs.cloud.google.com/looker/docs/2616/reference/param-view-table-compression.md.txt#dialect_support) |

## Definition

The `table_compression` parameter specifies the compression that a [persistent derived table](https://docs.cloud.google.com/looker/docs/2616/derived-tables.md.txt#persistent-derived-tables) (PDT) will have in an Athena database, either `GZIP` or `SNAPPY`.

See the [Amazon Athena documentation](https://docs.aws.amazon.com/athena/latest/ug/compression-formats.html) for details.
> See the [Dialect support for `table_compression`](https://docs.cloud.google.com/looker/docs/2616/reference/param-view-table-compression.md.txt#dialect_support) section for the list of dialects that support `table_compression`.

> The `table_compression` parameter works only with tables that are [persistent](https://docs.cloud.google.com/looker/docs/2616/derived-tables.md.txt#adding_persistence), such as PDTs and aggregate tables. `table_compression` is not supported for [derived tables](https://docs.cloud.google.com/looker/docs/2616/creating-ndts.md.txt) without a persistence strategy.

## Examples

Create a `customer_order_facts` PDT on an Amazon Athena database with SNAPPY compression:

    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
      }
    }

## Dialect support for `table_compression`

The ability to use `table_compression` depends on the database dialect your Looker connection is using. In the latest release of Looker, the following dialects support `table_compression`:

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