Git Product home page Git Product logo

docker-beeline's Introduction

Beeline packaged in a docker container

HIVE_VERSION=1.2.0
docker run --rm -ti --entrypoint=./beeline.sh sutoiku/beeline:hive-$HIVE_VERSION -u jdbc:hive2://localhost:10000/default

The default hive version is 1.2.0 to be compatible with HDP-2.4 and up. It also works for homebrew's 2.1.0 (Jan 2017)

For hive-1.2.0, we are using a patched version of beeline where the fix HIVE-7224 is applied (--incremental=true by default) and added an option --fetchSize to controle the size of the fetches).

Example:

Extract some data as csv:

./beeline.sh -u jdbc:hive2://localhost:10000/default --outputformat=csv2 --showHeader=true --color=false \
	--fetchSize=100000 \
	-e 'select * from u_data limit 10;' > theFileWhereToStoreTheData.csv

Full documentation: https://cwiki.apache.org/confluence/display/Hive/HiveServer2+Clients#HiveServer2Clients-Beeline–CommandLineShell

Note

If beeline cannot connect with the following error:

➜ HIVE_VERSION=2.1.1 ./beeline.sh -u jdbc:hive2://localhost:10000/default
Connecting to jdbc:hive2://localhost:10000/default
17/01/11 11:13:12 [main]: ERROR jdbc.HiveConnection: Error opening session
org.apache.thrift.TApplicationException: Required field 'client_protocol' is unset! Struct:TOpenSessionReq(client_protocol:null, configuration:{use:database=default})
	at org.apache.thrift.TApplicationException.read(TApplicationException.java:111) ~[hive-jdbc-2.1.1-standalone.jar:2.1.1]

Then the version of hive-jdbc in use does not match the version in the Hive cluster. Client using an older version of hive libraries seem to be comptible with newer servers. The opposite is not true.

For example, HDP-2.4 and HDP-2.5 are using hive-1.2.1; Homebrew is using hive-2.1.0; CDH-5.5 and up are using hive-1.1.0

License

The dockerfile and beeline startup script are public domain.

The libraries packaged in the docker image are under their respective original copyright and license.

The java libraries are all downloaded from maven central and identical to the ones found in an Apache Licensed Hadoop distribution.

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.