Search code examples
python-3.xgoogle-bigquerygoogle-cloud-storagegzipavro

Compress avro files to gzip (.gz) compression


I'm a newbie to avro and .gzip file. I'm trying to compress the avro file to get faster file loading time from Google Cloud Storage into BigQuery. And I've already tried to googling but I don't get the answer. Please help me on how to compress avro files to gzip (.gz) compression.


Solution

  • The Avro format can't be used in combination with GZIP compression. To compress Avro data, use the bq command-line tool or the API and specify one of the supported compression types for Avro data: DEFLATE or SNAPPY.

    Refrence:

    https://cloud.google.com/bigquery/docs/loading-data-cloud-storage-avro