-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6fcbc7a
commit 1d6121f
Showing
1 changed file
with
20 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,20 +15,20 @@ Applications can use this golang client library to query Apache Pinot. | |
|
||
Please follow this [Pinot Quickstart](https://docs.pinot.apache.org/basics/getting-started/running-pinot-locally) link to install and start Pinot batch quickstart locally. | ||
|
||
``` | ||
```sh | ||
bin/quick-start-batch.sh | ||
``` | ||
|
||
Check out Client library Github Repo | ||
|
||
``` | ||
```sh | ||
git clone [email protected]:startreedata/pinot-client-go.git | ||
cd pinot-client-go | ||
``` | ||
|
||
Build and run the example application to query from Pinot Batch Quickstart | ||
|
||
``` | ||
```sh | ||
go build ./examples/batch-quickstart | ||
./batch-quickstart | ||
``` | ||
|
@@ -37,20 +37,20 @@ go build ./examples/batch-quickstart | |
|
||
Please follow this [Pinot Quickstart](https://docs.pinot.apache.org/basics/getting-started/running-pinot-locally) link to install and start Pinot json batch quickstart locally. | ||
|
||
``` | ||
```sh | ||
bin/quick-start-json-index-batch.sh | ||
``` | ||
|
||
Check out Client library Github Repo | ||
|
||
``` | ||
```sh | ||
git clone [email protected]:startreedata/pinot-client-go.git | ||
cd pinot-client-go | ||
``` | ||
|
||
Build and run the example application to query from Pinot Json Batch Quickstart | ||
|
||
``` | ||
```sh | ||
go build ./examples/json-batch-quickstart | ||
./json-batch-quickstart | ||
``` | ||
|
@@ -63,13 +63,13 @@ Pinot client could be initialized through: | |
|
||
1. Zookeeper Path. | ||
|
||
``` | ||
```go | ||
pinotClient, err := pinot.NewFromZookeeper([]string{"localhost:2123"}, "", "QuickStartCluster") | ||
``` | ||
|
||
2. Controller address. | ||
|
||
``` | ||
```go | ||
pinotClient, err := pinot.NewFromController("localhost:9000") | ||
``` | ||
|
||
|
@@ -80,22 +80,22 @@ When the controller-based broker selector is used, the client will periodically | |
- For HTTP | ||
Default scheme is HTTP if not specified. | ||
|
||
``` | ||
```go | ||
pinotClient, err := pinot.NewFromBrokerList([]string{"localhost:8000"}) | ||
``` | ||
|
||
- For HTTPS | ||
Scheme is required to be part of the URI. | ||
|
||
``` | ||
```go | ||
pinotClient, err := pinot.NewFromBrokerList([]string{"https://pinot-broker.pinot.live"}) | ||
``` | ||
|
||
4. ClientConfig | ||
|
||
Via Zookeeper path: | ||
|
||
``` | ||
```go | ||
pinotClient, err := pinot.NewWithConfig(&pinot.ClientConfig{ | ||
ZkConfig: &pinot.ZookeeperConfig{ | ||
ZookeeperPath: zkPath, | ||
|
@@ -111,7 +111,7 @@ pinotClient, err := pinot.NewWithConfig(&pinot.ClientConfig{ | |
|
||
Via controller address: | ||
|
||
``` | ||
```go | ||
pinotClient, err := pinot.NewWithConfig(&pinot.ClientConfig{ | ||
ControllerConfig: &pinot.ControllerConfig{ | ||
ControllerAddress: "localhost:9000", | ||
|
@@ -133,7 +133,7 @@ pinotClient, err := pinot.NewWithConfig(&pinot.ClientConfig{ | |
|
||
By Default this client uses golang's default http timeout, which is "No TImeout". If you want pinot queries to timeout within given time, add `HTTPTimeout` in `ClientConfig` | ||
|
||
``` | ||
```go | ||
pinotClient, err := pinot.NewWithConfig(&pinot.ClientConfig{ | ||
ZkConfig: &pinot.ZookeeperConfig{ | ||
ZookeeperPath: zkPath, | ||
|
@@ -155,7 +155,7 @@ Please see this [example](https://github.com/startreedata/pinot-client-go/blob/m | |
|
||
Code snippet: | ||
|
||
``` | ||
```go | ||
pinotClient, err := pinot.NewFromZookeeper([]string{"localhost:2123"}, "", "QuickStartCluster") | ||
if err != nil { | ||
log.Error(err) | ||
|
@@ -173,14 +173,14 @@ Please see this [example](https://github.com/startreedata/pinot-client-go/blob/m | |
|
||
How to run it: | ||
|
||
``` | ||
```sh | ||
go build ./examples/multistage-quickstart | ||
./multistage-quickstart | ||
``` | ||
|
||
Code snippet: | ||
|
||
``` | ||
```go | ||
pinotClient, err := pinot.NewFromZookeeper([]string{"localhost:2123"}, "", "QuickStartCluster") | ||
if err != nil { | ||
log.Error(err) | ||
|
@@ -192,7 +192,7 @@ pinotClient.UseMultistageEngine(true) | |
|
||
Query Response is defined as the struct of following: | ||
|
||
``` | ||
```go | ||
type BrokerResponse struct { | ||
AggregationResults []*AggregationResult `json:"aggregationResults,omitempty"` | ||
SelectionResults *SelectionResults `json:"SelectionResults,omitempty"` | ||
|
@@ -220,7 +220,7 @@ Note that `AggregationResults` and `SelectionResults` are holders for PQL querie | |
Meanwhile `ResultTable` is the holder for SQL queries. | ||
`ResultTable` is defined as: | ||
|
||
``` | ||
```go | ||
// ResultTable is a ResultTable | ||
type ResultTable struct { | ||
DataSchema RespSchema `json:"dataSchema"` | ||
|
@@ -230,7 +230,7 @@ type ResultTable struct { | |
|
||
`RespSchema` is defined as: | ||
|
||
``` | ||
```go | ||
// RespSchema is response schema | ||
type RespSchema struct { | ||
ColumnDataTypes []string `json:"columnDataTypes"` | ||
|
@@ -240,7 +240,7 @@ type RespSchema struct { | |
|
||
There are multiple functions defined for `ResultTable`, like: | ||
|
||
``` | ||
```go | ||
func (r ResultTable) GetRowCount() int | ||
func (r ResultTable) GetColumnCount() int | ||
func (r ResultTable) GetColumnName(columnIndex int) string | ||
|