mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-08-28 10:54:59 +00:00
* initial changes to add bool support in idk * modifying some default parameters for testing, will revert them later * adding support for bool in making fragments function * boolean values implementation without supporting empty or null values at this point * Implement bool support in batch using a map (and a slice for nulls) (#2247) * Implement bool support in batch using a map (and a slice for nulls) * Keep the PackBools default for now But set it explicity in the ingest tests which rely on it. * Modify batch to construct bool update like mutex The code in API.ImportRoaringShard has a switch statement which causes bool fields to be handled like mutex fields. This means, that the viewUpdate.Clear value should only contain data in the first "row" of the fragment, which it will treat as records to clear for *all* rows. This makes more sense for mutex fields; for bool fields, there's only one other row to clear. But since the code is currently handling them the same, we need to construct viewUpdate.Clear such that it conforms to that pattern. This commit also adds a test which covers this logic. * Remove commented code; revert config for testing This commit also removes the DELETE_SENTINEL case for non-packed bools, since that isn't supported anyway. * Revert default setting * remove inconsistent type scope * correcting the logic of string converstion to bool * resolving an error in a test * adding tests to cover code related to bool support in batch.go file and interface.go files * modifying interfaces test * added one more test case Co-authored-by: Travis Turner <travis@pilosa.com> Co-authored-by: Travis Turner <travis@molecula.com> |
||
|---|---|---|
| .. | ||
| csv | ||
| docs | ||
| egpool | ||
| batch.go | ||
| batch_test.go | ||
| client.go | ||
| client_it_test.go | ||
| client_test.go | ||
| cluster.go | ||
| cluster_test.go | ||
| doc.go | ||
| error.go | ||
| ingest_api_batch.go | ||
| ingest_api_batch_test.go | ||
| logimport.go | ||
| logimport_test.go | ||
| main_test.go | ||
| metrics.go | ||
| orm.go | ||
| orm_test.go | ||
| README.md | ||
| record.go | ||
| record_test.go | ||
| response.go | ||
| response_test.go | ||
| shardnodes.go | ||
| tracer.go | ||
| validate.go | ||
| validate_test.go | ||
| version.go | ||
Go Client for Pilosa
Go client for Pilosa high performance distributed index.
Usage
If you have the pilosa repo in your GOPATH,
you can import the library in your code using:
import "github.com/pilosa/pilosa/v2/client"
Quick overview
Assuming Pilosa server is running at localhost:10101 (the default):
package main
import (
"fmt"
"github.com/pilosa/pilosa/v2/client"
)
func main() {
// Create the default client
cli := client.DefaultClient()
// Retrieve the schema
schema, err := cli.Schema()
// Create an Index object
myindex := schema.Index("myindex")
// Create a Field object
myfield := myindex.Field("myfield")
// make sure the index and the field exists on the server
err := cli.SyncSchema(schema)
// Send a Set query. If err is non-nil, response will be nil.
response, err := cli.Query(myfield.Set(5, 42))
// Send a Row query. If err is non-nil, response will be nil.
response, err = cli.Query(myfield.Row(5))
// Get the result
result := response.Result()
// Act on the result
if result != nil {
columns := result.Row().Columns
fmt.Println("Got columns: ", columns)
}
// You can batch queries to improve throughput
response, err = cli.Query(myindex.BatchQuery(
myfield.Row(5),
myfield.Row(10)))
if err != nil {
fmt.Println(err)
}
for _, result := range response.Results() {
// Act on the result
fmt.Println(result.Row().Columns)
}
}
Documentation
Data Model and Queries
Executing Queries
See: Server Interaction