Skip to content
Latest commit 2381306 Nov 6, 2012 YoungwooKim Minor fixes
Failed to load latest commit information.
.gitignore Initial commit Apr 9, 2012
README first commit Apr 9, 2012 Update Aug 17, 2012 Minor fixes Nov 6, 2012 Bump up version to 0.0.2 Apr 30, 2012

Hive FDW for PostgreSQL

This Python module implements the multicorn.ForeignDataWrapper interface to allow you to create foreign tables in PostgreSQL 9.1+ that query to tables in Apache Hive.



  1. Install Multicorn
  2. Install hive-thrift-py
  3. Build the FDW module:

    $ cd hive-fdw-for-postgresql
    $ python sdist
    $ sudo python install

    or, with easy_install:

    $ cd hive-fdw-for-postgresql
    $ sudo easy_install .
  4. In the PostgreSQL client, create an extension and foreign server:

    CREATE EXTENSION multicorn;
    CREATE SERVER multicorn_hive FOREIGN DATA WRAPPER multicorn
        wrapper 'hivefdw.HiveForeignDataWrapper'


  1. User can executes simple selects on a remote Hive table:

        a varchar,
        b varchar,
        c varchar,
        d varchar
    ) SERVER multicorn_hive OPTIONS (
        host 'tb081',
        port '10000',
        table 'test'
    SELECT * FROM hive;
  2. Also user can executes selects using a Hive query:

    CREATE FOREIGN TABLE hive_query (
        x varchar,
        y varchar,
        z varchar
    ) SERVER multicorn_hive OPTIONS (
        host 'tb081',
        port '10000',
        query 'SELECT x,y,z from src'
    SELECT * from hive_query;
Something went wrong with that request. Please try again.