Skip to content

Golang wrapper around the hiveserver2 Thrift interface

Notifications You must be signed in to change notification settings

charithe/hivething

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hivething is a small Go wrapper library around Hiveserver2 via its Thrift interface.

Usage

import (
  "github.com/derekgr/hivething"
)

func ListTablesAsync() []string {
  db, err := hivething.Connect("127.0.0.1:10000", hivething.DefaultOptions)
  if err != nil {
    // handle
  }
  defer db.Close()

  results, err := db.Query("SHOW TABLES")
  if err != nil {
      // handle
  }

  status, err := results.Wait()
  if err != nil {
      // handle
  }

  if status.IsSuccess() {
      var tableName string
      for results.Next() {
          results.Scan(&tableName)
          append(tables, tableName)
      }
  }
  else {
      // handle status.Error
  }

  return tables
}

About

Golang wrapper around the hiveserver2 Thrift interface

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 99.7%
  • Shell 0.3%