GithubHelp home page GithubHelp logo

cono / snowflake-hive-metastore-connector Goto Github PK

View Code? Open in Web Editor NEW

This project forked from snowflakedb/snowflake-hive-metastore-connector

0.0 0.0 0.0 343 KB

License: Apache License 2.0

Shell 4.57% Python 0.84% Java 94.59%

snowflake-hive-metastore-connector's Introduction

Snowflake Hive Metastore Connector

https://travis-ci.com/snowflakedb/snowflake-hive-metastore-connector.svg?branch=master https://maven-badges.herokuapp.com/maven-central/net.snowflake/snowflake-hive-metastore-connector/badge.svg?style=plastic

The Snowflake Hive metastore connector provides an easy way to query Hive-managed data via Snowflake. Once installed, the connector listens to Hive metastore events and creates the equivalent Snowflake objects. See also: https://docs.snowflake.net/manuals/user-guide/tables-external-hive.html

Installation:

  1. Create a new file named 'snowflake-config.xml' to the same directory that contains hive-site.xml. This will be the configuration file for the connector. This configuration file should look like:

    <configuration>
      <property>
        <name>snowflake.jdbc.username</name>
        <value>...</value>
      </property>
      <property>
        <name>snowflake.jdbc.password</name>
        <value>...</value>
      </property>
      <property>
        <name>snowflake.jdbc.role</name>
        <value>...</value>
      </property>
      <property>
        <name>snowflake.jdbc.account</name>
        <value>...</value>
      </property>
      <property>
        <name>snowflake.jdbc.db</name>
        <value>...</value>
      </property>
      <property>
        <name>snowflake.jdbc.schema</name>
        <value>...</value>
      </property>
      <property>
        <name>snowflake.jdbc.connection</name>
        <value>jdbc:snowflake://account.snowflakecomputing.com</value>
      </property>
      <property>
        <name>snowflake.hive-metastore-listener.integration</name>
        <value>...</value>
      </property>
    </configuration>
  2. Package the jar by running:

    mvn package

    Or download the jar from Maven: https://repo1.maven.org/maven2/net/snowflake/

  3. Copy the jar into the Hive classpath

  4. Update the Hive metastore configuration to point to the listener. To do this, simply add the following section to hive-site.xml:

    <configuration>
      ...
      <property>
        <name>hive.metastore.event.listeners</name>
        <value>net.snowflake.hivemetastoreconnector.SnowflakeHiveListener</value>
      </property>
    </configuration>
  5. Restart the Hive metastore.

Usage:

  1. In Hive, touch partitions to be used in Snowflake:

    alter table <table_name> touch partition <partition_spec>;
    

    Or for non-partitioned Hive tables:

    alter table <table_name> touch;
    
  2. Query the table in Snowflake:

    select * from <table_name>;
    

snowflake-hive-metastore-connector's People

Contributors

sfc-gh-wwong avatar sfc-gh-acelis avatar sfc-gh-asudhakar avatar sfc-gh-jfan avatar sfc-gh-hpathak avatar chyura avatar sfc-gh-nsfard avatar sfc-gh-spandey avatar snyk-bot avatar mend-for-github-com[bot] 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.