Skip to content

Commit

Permalink
GH-89: Add support for generating Flight related files
Browse files Browse the repository at this point in the history
Fix GH-89
  • Loading branch information
kou committed Sep 10, 2024
1 parent 0bd6715 commit 323dff1
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arrow/flight/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@

package flight

//go:generate protoc --experimental_allow_proto3_optional -I../../../format --go_out=./gen/flight --go-grpc_out=./gen/flight --go_opt=paths=source_relative --go-grpc_opt=paths=source_relative Flight.proto
//go:generate protoc --experimental_allow_proto3_optional -I../../../format --go_out=./gen/flight --go-grpc_out=./gen/flight --go_opt=paths=source_relative --go-grpc_opt=paths=source_relative FlightSql.proto
//go:generate protoc --experimental_allow_proto3_optional -I${APACHE_ARROW_FORMAT_DIR} --go_out=./gen/flight --go-grpc_out=./gen/flight --go_opt=paths=source_relative --go-grpc_opt=paths=source_relative Flight.proto
//go:generate protoc --experimental_allow_proto3_optional -I${APACHE_ARROW_FORMAT_DIR} --go_out=./gen/flight --go-grpc_out=./gen/flight --go_opt=paths=source_relative --go-grpc_opt=paths=source_relative FlightSql.proto
38 changes: 38 additions & 0 deletions dev/sync_flight.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/usr/bin/env bash
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

set -eux

source_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"

arrow_source="${source_dir}/arrow-source"
if [ -d "${arrow_source}" ]; then
have_arrow_source=true
else
have_arrow_source=false
git clone --depth 1 https://github.com/apache/arrow.git "${arrow_source}"
fi

pushd "${source_dir}/arrow/flight"
APACHE_ARROW_FORMAT_DIR="${arrow_source}/format" go generate gen.go
popd

if [ "${have_arrow_source}" = "false" ]; then
rm -rf "${arrow_source}"
fi

0 comments on commit 323dff1

Please sign in to comment.