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

export CALCITE_VER=calcite-1.8.0

Lukáš Lalinský's avatar
Lukáš Lalinský committed
5
rm -rf phoenixdb/calcite
6 7 8 9 10 11 12 13 14 15
rm -rf calcite-tmp

git init calcite-tmp
cd calcite-tmp
git remote add origin https://github.com/apache/calcite/
git config core.sparsecheckout true
echo "avatica/core/src/main/protobuf/*" >> .git/info/sparse-checkout
git pull --depth=1 origin $CALCITE_VER

cd ..
Lukáš Lalinský's avatar
Lukáš Lalinský committed
16 17 18
mkdir -p phoenixdb/calcite
protoc --proto_path=calcite-tmp/avatica/core/src/main/protobuf/ --python_out=phoenixdb/calcite calcite-tmp/avatica/core/src/main/protobuf/*.proto
sed -i 's/import common_pb2/from . import common_pb2/' phoenixdb/calcite/*_pb2.py
19 20 21

rm -rf calcite-tmp

Lukáš Lalinský's avatar
Lukáš Lalinský committed
22
echo '' >> phoenixdb/calcite/__init__.py