Giter Site home page Giter Site logo

akolb1 / gometastore Goto Github PK

View Code? Open in Web Editor NEW
14.0 5.0 19.0 687 KB

Go Client for Hive Metastore

License: Apache License 2.0

Go 65.16% Thrift 34.84%
hive metastore go golang hms thrift rest-api hive-metastore hive-metastore-client rest-client

gometastore's Introduction

gometastore

Tools for accessing Hive Metastore over thrift API.

The repository provides a set of tools for accessing Hive Metastore (HMS) directly using its Thrift interface rather then going via beeline. It can be use to explore and troubleshoot HMS and to develop other scripts and tools that need to access it.

Kerberos support

None of these tools work in kerberos-enabled cluster.

You should consider using Java-based toolkit if you need support for Kerberos.

Installation

Make sure that you have an up-to-date GO environment. Currently Go 1.11 or higher is required.

On MacOS this can be as easy as running

brew install go

Building:

go get -u github.com/akolb1/gometastore/...

This command will install tools in ~/go/bin directory.

gometastore's People

Contributors

akolb1 avatar robertino avatar sananguliyev avatar sap-nocops avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

gometastore's Issues

Wrong info is printed on connection error

When HMS_HOST has port associated with it, the error message shows:

2018/06/01 15:59:03 failed to open connection to host:9084:9083: dial tcp 10.16.0.83:9084: connect: connection refused

Note that the default port is tacked to the end which is wrong.

hmstool: Provide way to use server-side filtering for databases and tables.

hmstool allows for glob-style matching of database and table names, but the matching is performed on the client side. For instances with huge number of databases/tables this can become problematic, so it would be good to push matching to the server.

This will be done with the new -M flag for listing dbs and tables. When specified it will use server-side matching.

GetAllDatabases returns error 'EOF'

Hi I am running a remote Hive metastore on ec2 machine backed up by MySQL RDS as database.
HiveServer2 service is running on 10002 port.
I already created sample database in hive and a sample table inside it manually.
gometastore library is able to create a connection to Metastore but fails while getting result from GetAllDataases and return EOF error.

package main
import	(
    "log"
    "github.com/akolb1/gometastore/hmsclient"
)

func main() {
    client, err := hmsclient.Open("localhost", 10002)
    if err != nil {
	log.Println("Error when creating connection")
        log.Println(err)
    }
    databases, err := client.GetAllDatabases()
    log.Println(client)
    if err != nil {
	log.Println("Error inside GetAllDatabases")
        log.Println(err)
    }
    for _, d := range databases {
	log.Println(d)
    }
}

Hive CLI shows 2 dbs:

    > show databases;
OK
default
testdb
Time taken: 0.018 seconds, Fetched: 2 row(s)

Any help what could be wrong here?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.