Code Monkey home page Code Monkey logo

beeswax's Introduction

beeswax

Build Status Gitter chat

Monadic wrapper for the Hive API.

Scaladoc

Usage

See https://commbank.github.io/beeswax/index.html

Creating a table

Table schemas are derived from a thrift struct. The underlying storage format can either be text or parquet. Here is an example:

Hive.createParquetTable[Pair]("database", "table", List(("year", "int"), ("name", "string")))

Querying

Create actions that perform hive queries.

Hive.query("SELECT COUNT(*) FROM datable.table")

Multiple operations

Creates a table and inserts data into it from another table.

for {
  _ <- Hive.createTexttable[Pair]("test", "pairs", List.empty)
  _ <- Hive.query("INSERT INTO TABLE test.pairs FROM SELECT * FROM test2.pairs")
} yield ()

Running the Hive monad

import org.apache.hadoop.hive.conf.HiveConf

val hc: HiveConf                 = new HiveConf
val q: Hive[List[String]]        = Hive.query("SELECT COUNT(*) FROM datable.table")
val result: Result[List[String]] = q.run(hc)

Known Issues

  • Need to specify the Hive metastore as a thrift endpoint instead of the database.

      <property>
        <name>hive.metastore.uris</name>
        <value>thrift://metastore:9083</value>
      </property>
    
  • In order to run queries the hive-site.xml need to include the yarn.resourcemanager.address property even if the value is bogus.

      <property>
        <name>yarn.resourcemanager.address</name>
        <value>bogus</value>
      </property>
    
  • In order to run queries with partitioning the partition mode needs to be set to nonstrict.

      <property>
        <name>hive.exec.dynamic.partition.mode</name>
        <value>nonstrict</value>
      </property>
    

beeswax's People

Contributors

stephanh avatar markhibberd avatar mxswd avatar samroberts avatar afsalthaj avatar quintona avatar toddmowen avatar vineethvarghese avatar scurvydoggo avatar huragan avatar lancelet avatar kfish avatar jdcba avatar shyam334 avatar shyam334-w1 avatar autowrangler avatar jameshales avatar jithinjohn avatar mnikliborc avatar rayroestenburg avatar sujeshchirackkal avatar

Watchers

James Cloos avatar

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.