GithubHelp home page GithubHelp logo

spark-jdbc's Introduction

Spark JDBC Driver

Because the Spark 2.x ThriftServer doesn't implement the Hive JDBC Driver's Catalog API, when using Spark's version of the Hive JDBC driver (org.spark-project.hive:hive-jdbc:1.2.1.spark2) within BI tools such as DataGrip, the tools are unable to introspect the catalog schema (databases, tables, views, columns, etc).

This driver fixes that by wrapping the default Spark Hive Driver (org.spark-project.hive:hive-jdbc:1.2.1.spark2) and adds introspection support by implementing the missing calls with calls to Spark's SHOW/DESCRIBE commands.

Download

Go to Releases and download the latest JAR version.

Configuration

Add the new Driver to your BI tool using the downloaded jar.

The driver class is com.hindog.spark.jdbc.SparkDriver.

JDBC url patterns are same as the Hive Driver. You can also use spark for the driver scheme, so the JDBC url jdbc:hive2://<hostname>:<port>/ would be equivalent to jdbc:spark://<hostname>:<port>/

Building

Run sbt assembly:assembly to build the driver jar.

The output jar will be written to target/scala-2.11/spark-jdbc-<version>.jar and it will include all the required dependencies and so it will be quite large.

Limitations

  • Spark 2.x does not support multiple "catalogs", so a hard-coded catalog named Spark will be used. You can override this by setting the system property com.hindog.spark.jdbc.catalog.name with the desired catalog name.
  • Spark does not support column sizes, so the driver will return the value of the column's defaultSize value.
  • Spark DESCRIBE & SHOW commands return a limited amount of metadata, so most JDBC metadata will not be populated.
  • Introspection can take some time to run as a separate SQL statement must be issued to introspect each database/table/column/function, etc.

spark-jdbc's People

Contributors

hindog avatar

Stargazers

Hairui Guo avatar Eddie Pantridge avatar

Watchers

James Cloos avatar  avatar

Forkers

hr1006

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.