gen-protobuf.sh 543 Bytes
Newer Older
1 2
#!/usr/bin/env bash

3 4 5
AVATICA_VER=rel/avatica-1.10.0

set -e
6

7
rm -rf avatica-tmp
8

9 10
mkdir avatica-tmp
cd avatica-tmp
11 12
wget -O avatica.tar.gz https://github.com/apache/calcite-avatica/archive/$AVATICA_VER.tar.gz
tar -x --strip-components=1 -f avatica.tar.gz
13 14

cd ..
15 16 17
rm -f phoenixdb/avatica/proto/*_pb2.py
protoc --proto_path=avatica-tmp/core/src/main/protobuf/ --python_out=phoenixdb/avatica/proto avatica-tmp/core/src/main/protobuf/*.proto
sed -i 's/import common_pb2/from . import common_pb2/' phoenixdb/avatica/proto/*_pb2.py
18

19
rm -rf avatica-tmp