Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
shaloi authored Jan 2, 2019
1 parent 10f15d7 commit 7c1f81e
Showing 1 changed file with 2 additions and 50 deletions.
52 changes: 2 additions & 50 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,51 +1,3 @@
Impalathing is a small Go wrapper library the thrift interface go Impala
go-impala is a Go driver for Cloudera Impala

It's based on [hivething](https://github.com/derekgr/hivething)

Working on this you quickly realize that having strings deliminated by tabs is a ugly API... (That's the thrift
side of things)

## Usage

```go
package main

import (
"log"
"fmt"
"time"
"github.com/bippio/impalathing"
)

func main() {
host := "impala-host"
port := 21000

con, err := impalathing.Connect(host, port, impalathing.DefaultOptions)

if err != nil {
log.Fatal("Error connecting", err)
return
}

query, err := con.Query("SELECT user_id, action, yyyymm FROM engagements LIMIT 10000")

startTime := time.Now()
total := 0
for query.Next() {
var (
user_id string
action string
yyyymm int
)

query.Scan(&user_id, &action, &yyyymm)
total += 1

fmt.Println(user_id, action)
}

log.Printf("Fetch %d rows(s) in %.2fs", total, time.Duration(time.Since(startTime)).Seconds())
}

```
It's based on [impalathing](https://github.com/koblas/impalathing)

0 comments on commit 7c1f81e

Please sign in to comment.