github.com/fraugster/parquet-go@v0.12.0/parquet/generate.sh (about)

     1  #!/usr/bin/env bash
     2  set -euo pipefail
     3  
     4  PARQUET_TAG=${PARQUET_TAG:-"apache-parquet-format-2.9.0"}
     5  
     6  message_exit() {
     7      echo $1
     8      exit 1
     9  }
    10  
    11  type curl &> /dev/null || message_exit "curl is required and is not available"
    12  type thrift &> /dev/null || message_exit "thrift is required and is not available"
    13  
    14  DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
    15  PKG=${DIR##*/}
    16  curl https://raw.githubusercontent.com/apache/parquet-format/${PARQUET_TAG}/src/main/thrift/parquet.thrift > ${DIR}/parquet.thrift
    17  thrift --out .. --gen go:package=${PKG} parquet.thrift