Skip to content

Commit

Permalink
docs: language highlighting (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
samialdury committed Apr 7, 2024
1 parent 6fcbc7a commit 1d6121f
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand All @@ -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
```
Expand All @@ -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")
```

Expand All @@ -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,
Expand All @@ -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",
Expand All @@ -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,
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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"`
Expand Down Expand Up @@ -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"`
Expand All @@ -230,7 +230,7 @@ type ResultTable struct {

`RespSchema` is defined as:

```
```go
// RespSchema is response schema
type RespSchema struct {
ColumnDataTypes []string `json:"columnDataTypes"`
Expand All @@ -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
Expand Down

0 comments on commit 1d6121f

Please sign in to comment.