Skip to content

Commit b4c09cf

Browse files
authored
Add gRPC broker support and examples (#57)
Add gRPC client transport, protobuf definitions, compression tests, and a broker example alongside docs and config wiring. Add gRPC transport and proto tests, plus injectable helpers to cover Expose the broker gRPC port, add gRPC integration tests with compression checks, and pass the port through CI integration runs.
1 parent f55e721 commit b4c09cf

24 files changed

+3546
-30
lines changed

.github/workflows/tests.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,20 +83,29 @@ jobs:
8383
- name: Set up Pinot Cluster
8484
run: make run-pinot-dist
8585
env:
86-
PINOT_VERSION: 1.0.0
86+
PINOT_VERSION: 1.4.0
8787
PINOT_HOME: /tmp/pinot
8888
CONTROLLER_PORT_FORWARD: 9000
8989
BROKER_PORT_FORWARD: 8000
90-
91-
- name: GORM Example
92-
run: go run ./examples/gorm-example
90+
BROKER_GRPC_PORT_FORWARD: 8010
91+
92+
- name: All Examples
93+
run: |
94+
set -euo pipefail
95+
go run ./examples/batch-quickstart
96+
go run ./examples/gorm-example
97+
go run ./examples/grpc-broker-client
98+
go run ./examples/json-batch-quickstart
99+
go run ./examples/multistage-quickstart
100+
go run ./examples/prepared-statement-example
93101
94102
- name: Integration Test
95103
run: make integration-test
96104
env:
97105
ZOOKEEPER_PORT: 2123
98106
CONTROLLER_PORT: 9000
99107
BROKER_PORT: 8000
108+
BROKER_GRPC_PORT: 8010
100109

101110
- name: Publish to coveralls.io
102111
uses: coverallsapp/github-action@v2

AGENTS.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# AGENTS.md
2+
3+
Repo-specific instructions for coding agents working on this project.
4+
5+
## Repo layout
6+
- `pinot/`: core client library (HTTP + gRPC).
7+
- `gormpinot/`: GORM dialector for Pinot.
8+
- `examples/`: runnable examples (not part of default tests).
9+
- `integration-tests/`: integration tests that require a running Pinot quickstart.
10+
- `scripts/`: helper scripts to start/stop Pinot quickstart.
11+
12+
## Tooling & style
13+
- Go version is defined in `go.mod`; use that version for builds/tests.
14+
- Run `gofmt` on modified Go files and keep `go vet` clean.
15+
- Update `go.mod`/`go.sum` only when dependencies change (run `go mod tidy` if needed).
16+
17+
## Commit requirements
18+
- Enable repo hooks with `make hooks` (uses `.githooks/pre-commit`).
19+
- Pre-commit runs `make lint`, `make test`, and `scripts/check-coverage.sh`.
20+
- Update the coverage baseline with `make coverage-baseline` after legitimate coverage improvements.
21+
22+
## Common commands (from `Makefile`)
23+
- Build: `make build` (or `go build ./...`).
24+
- Unit tests: `make test` (excludes `examples/` and `integration-tests/`).
25+
- Lint: `make lint` (gofmt, go vet, golangci-lint v2).
26+
- Integration tests: `make integration-test` (requires Pinot running).
27+
- Start Pinot quickstart (local dist): `make run-pinot-dist`.
28+
- Stop Pinot quickstart: `make stop-pinot-dist`.
29+
- Start Pinot quickstart (Docker): `make run-pinot-docker`.
30+
- Stop Pinot quickstart (Docker): `make stop-pinot-docker`.
31+
32+
## Integration test notes
33+
- gRPC tests read `BROKER_GRPC_HOST` and `BROKER_GRPC_PORT` (defaults: `127.0.0.1:8010`).
34+
- The quickstart script supports `PINOT_VERSION`, `PINOT_HOME`, `BROKER_PORT_FORWARD`, `BROKER_GRPC_PORT_FORWARD`.
35+
- `scripts/start-pinot-quickstart.sh` uses `curl` and `jq` to verify the cluster is ready.
36+
37+
## When changing public APIs
38+
- Update examples and tests that reference exported types or behavior changes.

Makefile

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ stop-pinot-dist:
4949

5050
.PHONY: run-pinot-docker
5151
run-pinot-docker:
52-
docker run --name pinot-quickstart -p 2123:2123 -p 9000:9000 -p 8000:8000 apachepinot/pinot:latest QuickStart -type MULTI_STAGE
52+
docker run --name pinot-quickstart -p 2123:2123 -p 9000:9000 -p 8000:8000 -p 8010:8010 apachepinot/pinot:latest QuickStart -type MULTI_STAGE
5353

5454
.PHONY: stop-pinot-docker
5555
stop-pinot-docker:
@@ -59,3 +59,15 @@ stop-pinot-docker:
5959
.PHONY: integration-test
6060
integration-test: build
6161
go test -timeout 500s -v -race -covermode atomic -coverprofile=coverage.out $(INTEGRATION_TESTS_PACKAGES)
62+
63+
.PHONY: coverage-check
64+
coverage-check: test
65+
./scripts/check-coverage.sh
66+
67+
.PHONY: coverage-baseline
68+
coverage-baseline: test
69+
./scripts/update-coverage-baseline.sh
70+
71+
.PHONY: hooks
72+
hooks:
73+
git config core.hooksPath .githooks

README.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Pinot Client GO
22

3-
[![Go 1.19](https://img.shields.io/badge/go-1.19-blue.svg)](https://golang.org/dl/#go1.19)
3+
[![Go 1.24](https://img.shields.io/badge/go-1.24-blue.svg)](https://golang.org/dl/#go1.24)
44
[![GoDoc](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white)](https://pkg.go.dev/github.com/startreedata/pinot-client-go)
55
[![Build Status](https://github.com/startreedata/pinot-client-go/actions/workflows/tests.yml/badge.svg)](https://github.com/startreedata/pinot-client-go/actions/workflows/tests.yml)
66
[![Coverage Status](https://coveralls.io/repos/github/startreedata/pinot-client-go/badge.svg?branch=master)](https://coveralls.io/github/startreedata/pinot-client-go?branch=master)
@@ -149,6 +149,26 @@ pinotClient, err := pinot.NewWithConfig(&pinot.ClientConfig{
149149
})
150150
```
151151

152+
### gRPC broker queries
153+
154+
Pinot brokers expose a gRPC query endpoint when configured with `pinot.broker.grpc.port`. See the Pinot gRPC broker API docs for configuration details and TLS setup: https://docs.pinot.apache.org/users/api/broker-grpc-api
155+
156+
```go
157+
pinotClient, err := pinot.NewWithConfig(&pinot.ClientConfig{
158+
BrokerList: []string{"localhost:8010"},
159+
GrpcConfig: &pinot.GrpcConfig{
160+
Encoding: "JSON", // or "ARROW"
161+
Compression: "ZSTD",
162+
BlockRowSize: 10000,
163+
Timeout: 5 * time.Second,
164+
// TLSConfig: &pinot.GrpcTLSConfig{
165+
// Enabled: true,
166+
// CACertPath: "/path/to/ca.pem",
167+
// },
168+
},
169+
})
170+
```
171+
152172
## Query Pinot
153173

154174
Please see this [example](https://github.com/startreedata/pinot-client-go/blob/master/examples/batch-quickstart/main.go) for your reference.
@@ -534,4 +554,3 @@ Go to [Github Release](https://github.com/startreedata/pinot-client-go/releases)
534554
The published Release will be available in [Go Modules](https://pkg.go.dev/github.com/startreedata/pinot-client-go).
535555

536556
If not available, go to the corresponding new version page (https://pkg.go.dev/github.com/startreedata/[email protected]) and click on the "Request New Version" button.
537-
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
package main
2+
3+
import (
4+
"encoding/json"
5+
"fmt"
6+
"time"
7+
8+
log "github.com/sirupsen/logrus"
9+
pinot "github.com/startreedata/pinot-client-go/pinot"
10+
)
11+
12+
func main() {
13+
pinotClient, err := pinot.NewWithConfig(&pinot.ClientConfig{
14+
BrokerList: []string{"localhost:8010"},
15+
GrpcConfig: &pinot.GrpcConfig{
16+
Encoding: "JSON",
17+
Compression: "ZSTD",
18+
BlockRowSize: 10000,
19+
Timeout: 5 * time.Second,
20+
// TLSConfig: &pinot.GrpcTLSConfig{
21+
// Enabled: true,
22+
// CACertPath: "/path/to/ca.pem",
23+
// },
24+
},
25+
})
26+
if err != nil {
27+
log.Fatalln(err)
28+
}
29+
30+
table := "baseballStats"
31+
query := "select * from baseballStats where teamID = 'OAK' and yearID = 2004 order by homeRuns desc limit 5"
32+
brokerResp, err := pinotClient.ExecuteSQL(table, query)
33+
if err != nil {
34+
log.Fatalln(err)
35+
}
36+
printBrokerResp(brokerResp)
37+
}
38+
39+
func printBrokerResp(brokerResp *pinot.BrokerResponse) {
40+
log.Infof("Query Stats: response time - %d ms, scanned docs - %d, total docs - %d", brokerResp.TimeUsedMs, brokerResp.NumDocsScanned, brokerResp.TotalDocs)
41+
if len(brokerResp.Exceptions) > 0 {
42+
jsonBytes, _ := json.Marshal(brokerResp.Exceptions)
43+
log.Infof("brokerResp.Exceptions:\n%s\n", jsonBytes)
44+
return
45+
}
46+
if brokerResp.ResultTable != nil {
47+
jsonBytes, _ := json.Marshal(brokerResp.ResultTable)
48+
log.Infof("brokerResp.ResultTable:\n%s\n", jsonBytes)
49+
line := ""
50+
for c := 0; c < brokerResp.ResultTable.GetColumnCount(); c++ {
51+
line += fmt.Sprintf("%s(%s)\t", brokerResp.ResultTable.GetColumnName(c), brokerResp.ResultTable.GetColumnDataType(c))
52+
}
53+
line += "\n"
54+
for r := 0; r < brokerResp.ResultTable.GetRowCount(); r++ {
55+
for c := 0; c < brokerResp.ResultTable.GetColumnCount(); c++ {
56+
line += fmt.Sprintf("%v\t", brokerResp.ResultTable.Get(r, c))
57+
}
58+
line += "\n"
59+
}
60+
log.Infof("ResultTable:\n%s", line)
61+
}
62+
}

go.mod

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,44 @@
11
module github.com/startreedata/pinot-client-go
22

33
require (
4+
github.com/apache/arrow/go/v15 v15.0.2
45
github.com/go-zookeeper/zk v1.0.4
6+
github.com/golang/snappy v1.0.0
7+
github.com/klauspost/compress v1.18.3
8+
github.com/pierrec/lz4/v4 v4.1.25
59
github.com/sirupsen/logrus v1.9.4
610
github.com/stretchr/testify v1.11.1
11+
google.golang.org/grpc v1.78.0
12+
google.golang.org/protobuf v1.36.11
713
)
814

915
require (
16+
github.com/goccy/go-json v0.10.2 // indirect
17+
github.com/google/flatbuffers v23.5.26+incompatible // indirect
1018
github.com/jinzhu/inflection v1.0.0 // indirect
1119
github.com/jinzhu/now v1.1.5 // indirect
12-
golang.org/x/text v0.20.0 // indirect
20+
github.com/klauspost/cpuid/v2 v2.2.5 // indirect
21+
github.com/zeebo/xxh3 v1.0.2 // indirect
22+
golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect
23+
golang.org/x/mod v0.29.0 // indirect
24+
golang.org/x/net v0.47.0 // indirect
25+
golang.org/x/sync v0.18.0 // indirect
26+
golang.org/x/telemetry v0.0.0-20251008203120-078029d740a8 // indirect
27+
golang.org/x/text v0.31.0 // indirect
28+
golang.org/x/tools v0.38.0 // indirect
29+
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
30+
google.golang.org/genproto/googleapis/rpc v0.0.0-20251029180050-ab9386a59fda // indirect
1331
)
1432

1533
require (
1634
github.com/davecgh/go-spew v1.1.1 // indirect
1735
github.com/pmezard/go-difflib v1.0.0 // indirect
1836
github.com/stretchr/objx v0.5.2 // indirect
19-
golang.org/x/sys v0.13.0 // indirect
37+
golang.org/x/sys v0.38.0 // indirect
2038
gopkg.in/yaml.v3 v3.0.1 // indirect
2139
gorm.io/gorm v1.31.1
2240
)
2341

24-
go 1.19
42+
go 1.24.0
43+
44+
toolchain go1.24.4

go.sum

Lines changed: 67 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,35 @@
1+
github.com/apache/arrow/go/v15 v15.0.2 h1:60IliRbiyTWCWjERBCkO1W4Qun9svcYoZrSLcyOsMLE=
2+
github.com/apache/arrow/go/v15 v15.0.2/go.mod h1:DGXsR3ajT524njufqf95822i+KTh+yea1jass9YXgjA=
13
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
24
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
5+
github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=
6+
github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
7+
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
8+
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
39
github.com/go-zookeeper/zk v1.0.4 h1:DPzxraQx7OrPyXq2phlGlNSIyWEsAox0RJmjTseMV6I=
410
github.com/go-zookeeper/zk v1.0.4/go.mod h1:nOB03cncLtlp4t+UAkGSV+9beXP/akpekBwL+UX1Qcw=
11+
github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU=
12+
github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=
13+
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
14+
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
15+
github.com/golang/snappy v1.0.0 h1:Oy607GVXHs7RtbggtPBnr2RmDArIsAefDwvrdWvRhGs=
16+
github.com/golang/snappy v1.0.0/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
17+
github.com/google/flatbuffers v23.5.26+incompatible h1:M9dgRyhJemaM4Sw8+66GHBu8ioaQmyPLg1b8VwK5WJg=
18+
github.com/google/flatbuffers v23.5.26+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8=
19+
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
20+
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
21+
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
22+
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
523
github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E=
624
github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc=
725
github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ=
826
github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
27+
github.com/klauspost/compress v1.18.3 h1:9PJRvfbmTabkOX8moIpXPbMMbYN60bWImDDU7L+/6zw=
28+
github.com/klauspost/compress v1.18.3/go.mod h1:R0h/fSBs8DE4ENlcrlib3PsXS61voFxhIs2DeRhCvJ4=
29+
github.com/klauspost/cpuid/v2 v2.2.5 h1:0E5MSMDEoAulmXNFquVs//DdoomxaoTY1kUhbc/qbZg=
30+
github.com/klauspost/cpuid/v2 v2.2.5/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws=
31+
github.com/pierrec/lz4/v4 v4.1.25 h1:kocOqRffaIbU5djlIBr7Wh+cx82C0vtFb0fOurZHqD0=
32+
github.com/pierrec/lz4/v4 v4.1.25/go.mod h1:EoQMVJgeeEOMsCqCzqFm2O0cJvljX2nGZjcRIPL34O4=
933
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
1034
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
1135
github.com/sirupsen/logrus v1.9.4 h1:TsZE7l11zFCLZnZ+teH4Umoq5BhEIfIzfRDZ1Uzql2w=
@@ -14,10 +38,49 @@ github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY=
1438
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
1539
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
1640
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
17-
golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE=
18-
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
19-
golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug=
20-
golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4=
41+
github.com/zeebo/assert v1.3.0 h1:g7C04CbJuIDKNPFHmsk4hwZDO5O+kntRxzaUoNXj+IQ=
42+
github.com/zeebo/assert v1.3.0/go.mod h1:Pq9JiuJQpG8JLJdtkwrJESF0Foym2/D9XMU5ciN/wJ0=
43+
github.com/zeebo/xxh3 v1.0.2 h1:xZmwmqxHZA8AI603jOQ0tMqmBr9lPeFwGg6d+xy9DC0=
44+
github.com/zeebo/xxh3 v1.0.2/go.mod h1:5NWz9Sef7zIDm2JHfFlcQvNekmcEl9ekUZQQKCYaDcA=
45+
go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64=
46+
go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y=
47+
go.opentelemetry.io/otel v1.38.0 h1:RkfdswUDRimDg0m2Az18RKOsnI8UDzppJAtj01/Ymk8=
48+
go.opentelemetry.io/otel v1.38.0/go.mod h1:zcmtmQ1+YmQM9wrNsTGV/q/uyusom3P8RxwExxkZhjM=
49+
go.opentelemetry.io/otel/metric v1.38.0 h1:Kl6lzIYGAh5M159u9NgiRkmoMKjvbsKtYRwgfrA6WpA=
50+
go.opentelemetry.io/otel/metric v1.38.0/go.mod h1:kB5n/QoRM8YwmUahxvI3bO34eVtQf2i4utNVLr9gEmI=
51+
go.opentelemetry.io/otel/sdk v1.38.0 h1:l48sr5YbNf2hpCUj/FoGhW9yDkl+Ma+LrVl8qaM5b+E=
52+
go.opentelemetry.io/otel/sdk v1.38.0/go.mod h1:ghmNdGlVemJI3+ZB5iDEuk4bWA3GkTpW+DOoZMYBVVg=
53+
go.opentelemetry.io/otel/sdk/metric v1.38.0 h1:aSH66iL0aZqo//xXzQLYozmWrXxyFkBJ6qT5wthqPoM=
54+
go.opentelemetry.io/otel/sdk/metric v1.38.0/go.mod h1:dg9PBnW9XdQ1Hd6ZnRz689CbtrUp0wMMs9iPcgT9EZA=
55+
go.opentelemetry.io/otel/trace v1.38.0 h1:Fxk5bKrDZJUH+AMyyIXGcFAPah0oRcT+LuNtJrmcNLE=
56+
go.opentelemetry.io/otel/trace v1.38.0/go.mod h1:j1P9ivuFsTceSWe1oY+EeW3sc+Pp42sO++GHkg4wwhs=
57+
golang.org/x/exp v0.0.0-20231006140011-7918f672742d h1:jtJma62tbqLibJ5sFQz8bKtEM8rJBtfilJ2qTU199MI=
58+
golang.org/x/exp v0.0.0-20231006140011-7918f672742d/go.mod h1:ldy0pHrwJyGW56pPQzzkH36rKxoZW1tw7ZJpeKx+hdo=
59+
golang.org/x/mod v0.29.0 h1:HV8lRxZC4l2cr3Zq1LvtOsi/ThTgWnUk/y64QSs8GwA=
60+
golang.org/x/mod v0.29.0/go.mod h1:NyhrlYXJ2H4eJiRy/WDBO6HMqZQ6q9nk4JzS3NuCK+w=
61+
golang.org/x/net v0.47.0 h1:Mx+4dIFzqraBXUugkia1OOvlD6LemFo1ALMHjrXDOhY=
62+
golang.org/x/net v0.47.0/go.mod h1:/jNxtkgq5yWUGYkaZGqo27cfGZ1c5Nen03aYrrKpVRU=
63+
golang.org/x/sync v0.18.0 h1:kr88TuHDroi+UVf+0hZnirlk8o8T+4MrK6mr60WkH/I=
64+
golang.org/x/sync v0.18.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=
65+
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
66+
golang.org/x/sys v0.38.0 h1:3yZWxaJjBmCWXqhN1qh02AkOnCQ1poK6oF+a7xWL6Gc=
67+
golang.org/x/sys v0.38.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
68+
golang.org/x/telemetry v0.0.0-20251008203120-078029d740a8 h1:LvzTn0GQhWuvKH/kVRS3R3bVAsdQWI7hvfLHGgh9+lU=
69+
golang.org/x/telemetry v0.0.0-20251008203120-078029d740a8/go.mod h1:Pi4ztBfryZoJEkyFTI5/Ocsu2jXyDr6iSdgJiYE/uwE=
70+
golang.org/x/text v0.31.0 h1:aC8ghyu4JhP8VojJ2lEHBnochRno1sgL6nEi9WGFGMM=
71+
golang.org/x/text v0.31.0/go.mod h1:tKRAlv61yKIjGGHX/4tP1LTbc13YSec1pxVEWXzfoeM=
72+
golang.org/x/tools v0.38.0 h1:Hx2Xv8hISq8Lm16jvBZ2VQf+RLmbd7wVUsALibYI/IQ=
73+
golang.org/x/tools v0.38.0/go.mod h1:yEsQ/d/YK8cjh0L6rZlY8tgtlKiBNTL14pGDJPJpYQs=
74+
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk=
75+
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8=
76+
gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk=
77+
gonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E=
78+
google.golang.org/genproto/googleapis/rpc v0.0.0-20251029180050-ab9386a59fda h1:i/Q+bfisr7gq6feoJnS/DlpdwEL4ihp41fvRiM3Ork0=
79+
google.golang.org/genproto/googleapis/rpc v0.0.0-20251029180050-ab9386a59fda/go.mod h1:7i2o+ce6H/6BluujYR+kqX3GKH+dChPTQU19wjRPiGk=
80+
google.golang.org/grpc v1.78.0 h1:K1XZG/yGDJnzMdd/uZHAkVqJE+xIDOcmdSFZkBUicNc=
81+
google.golang.org/grpc v1.78.0/go.mod h1:I47qjTo4OKbMkjA/aOOwxDIiPSBofUtQUI5EfpWvW7U=
82+
google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE=
83+
google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=
2184
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
2285
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
2386
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=

integration-tests/batch_quickstart_test.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,12 @@ func getEnv(key, defaultValue string) string {
2525
}
2626

2727
var (
28+
brokerHost = getEnv("BROKER_HOST", "127.0.0.1")
2829
brokerPort = getEnv("BROKER_PORT", "8000")
2930
)
3031

3132
func getPinotClientFromBroker(useMultistageEngine bool) *pinot.Connection {
32-
pinotClient, err := pinot.NewFromBrokerList([]string{"localhost:" + brokerPort})
33+
pinotClient, err := pinot.NewFromBrokerList([]string{brokerHost + ":" + brokerPort})
3334
if err != nil {
3435
log.Fatalln(err)
3536
}
@@ -55,7 +56,7 @@ func getCustomHTTPClient() *http.Client {
5556
}
5657

5758
func getPinotClientFromBrokerAndCustomHTTPClient(useMultistageEngine bool) *pinot.Connection {
58-
pinotClient, err := pinot.NewFromBrokerListAndClient([]string{"localhost:" + brokerPort}, getCustomHTTPClient())
59+
pinotClient, err := pinot.NewFromBrokerListAndClient([]string{brokerHost + ":" + brokerPort}, getCustomHTTPClient())
5960
if err != nil {
6061
log.Fatalln(err)
6162
}
@@ -65,7 +66,7 @@ func getPinotClientFromBrokerAndCustomHTTPClient(useMultistageEngine bool) *pino
6566

6667
func getPinotClientFromConfig(useMultistageEngine bool) *pinot.Connection {
6768
pinotClient, err := pinot.NewWithConfig(&pinot.ClientConfig{
68-
BrokerList: []string{"localhost:" + brokerPort},
69+
BrokerList: []string{brokerHost + ":" + brokerPort},
6970
HTTPTimeout: 10 * time.Second,
7071
ExtraHTTPHeader: map[string]string{},
7172
})
@@ -78,7 +79,7 @@ func getPinotClientFromConfig(useMultistageEngine bool) *pinot.Connection {
7879

7980
func getPinotClientFromConfigAndCustomHTTPClient(useMultistageEngine bool) *pinot.Connection {
8081
pinotClient, err := pinot.NewWithConfigAndClient(&pinot.ClientConfig{
81-
BrokerList: []string{"localhost:" + brokerPort},
82+
BrokerList: []string{brokerHost + ":" + brokerPort},
8283
HTTPTimeout: 10 * time.Second,
8384
ExtraHTTPHeader: map[string]string{},
8485
}, getCustomHTTPClient())

0 commit comments

Comments
 (0)