All Projects → pauldeschacht → Impala Java Client

pauldeschacht / Impala Java Client

Java client to connect directly to Impala using thrift

Labels

Projects that are alternatives of or similar to Impala Java Client

Yarpc Go
A message passing platform for Go
Stars: ✭ 285 (+996.15%)
Mutual labels:  thrift
Viper
Viper 是一个基于Anno微服务引擎开发的Dashboard项目、示例项目。Anno 底层通讯采用 grpc、thrift。自带服务发现、调用链追踪、Cron 调度、限流、事件总线等等
Stars: ✭ 402 (+1446.15%)
Mutual labels:  thrift
Bender
An easy-to-use library for creating load testing applications
Stars: ✭ 583 (+2142.31%)
Mutual labels:  thrift
Elves
开源自动化运维开发平台(IT Automatic Develop Platform)
Stars: ✭ 290 (+1015.38%)
Mutual labels:  thrift
Kyuubi
Kyuubi is a unified multi-tenant JDBC interface for large-scale data processing and analytics, built on top of Apache Spark
Stars: ✭ 363 (+1296.15%)
Mutual labels:  thrift
Javaspringbootsamples
SpringBoot、Dubbo、SpringCloud的各种集成例子:Atomikos、gRPC、Thrift、Seata、ShardingSphere、Dubbo、Hmily、Nacos、Consul、Ribbon、Jedis、Lettuce、Redisson等框架
Stars: ✭ 399 (+1434.62%)
Mutual labels:  thrift
thrift2ts
🚀 Parse Thrift (IDL) to TypeScript and generate thrift clients meanwhile.
Stars: ✭ 21 (-19.23%)
Mutual labels:  thrift
Zys
high performance service framework based on Yaf or Swoole
Stars: ✭ 812 (+3023.08%)
Mutual labels:  thrift
Spring Cloud Microservice Examples
spring-cloud-microservice-examples
Stars: ✭ 372 (+1330.77%)
Mutual labels:  thrift
Cpp Serializers
Benchmark comparing various data serialization libraries (thrift, protobuf etc.) for C++
Stars: ✭ 533 (+1950%)
Mutual labels:  thrift
Riffed
Provides idiomatic Elixir bindings for Apache Thrift
Stars: ✭ 290 (+1015.38%)
Mutual labels:  thrift
Springboot Learning
基于Gradle构建,使用SpringBoot在各个场景的应用,包括集成消息中间件、前后端分离、数据库、缓存、分布式锁、分布式事务等
Stars: ✭ 340 (+1207.69%)
Mutual labels:  thrift
Thrifty
Thrift for Android that saves you methods
Stars: ✭ 476 (+1730.77%)
Mutual labels:  thrift
Armeria
Your go-to microservice framework for any situation, from the creator of Netty et al. You can build any type of microservice leveraging your favorite technologies, including gRPC, Thrift, Kotlin, Retrofit, Reactive Streams, Spring Boot and Dropwizard.
Stars: ✭ 3,392 (+12946.15%)
Mutual labels:  thrift
Jboot
一个优雅的微服务框架,SpringCloud 之外的另一个选择,已经使用在用户量过亿的商业产品上,有超过1000家公司在使用Jboot做极速开发...
Stars: ✭ 655 (+2419.23%)
Mutual labels:  thrift
Turbo
A lightweight microservice tool, turn your grpc|thrift APIs into HTTP APIs!
Stars: ✭ 275 (+957.69%)
Mutual labels:  thrift
Thriftpy2
Pure python approach of Apache Thrift.
Stars: ✭ 402 (+1446.15%)
Mutual labels:  thrift
Node Thrift2 Hbase
An HBase thrift wrapper for Node.js
Stars: ✭ 18 (-30.77%)
Mutual labels:  thrift
Scrooge
A Thrift parser/generator
Stars: ✭ 724 (+2684.62%)
Mutual labels:  thrift
Srpc
RPC based on C++ Workflow
Stars: ✭ 521 (+1903.85%)
Mutual labels:  thrift

impala-java-client

A Java client that allows to connect directly to Impala. This is similar to the impala-shell, which is using Python. It does not depend on the HiveServer2.

Using

The test shows how to use the impala java client.

    //from external dependencies
    import org.apache.thrift.transport.*;
    import org.apache.thrift.protocol.*;
    //from ImpalaConnect jar
    import com.cloudera.impala.thrift.*;
    import com.cloudera.beeswax.api.*;

    try {
        //open connection
        TSocket transport = new TSocket(host,port);
        transport.open();
        TProtocol protocol = new TBinaryProtocol(transport);
        //connect to client
        ImpalaService$Client client = new ImpalaService.Client(protocol);
        client.PingImpalaService();
        //send the query            
        Query query = new Query();
        query.setQuery("SELECT * FROM <table> LIMIT 5");
        //fetch the results
        QueryHandle handle = client.query(query);
        Results results = client.fetch(handle,false,100);
        List<String> data = results.data;
        for(int i=0;i<data.size();i++) {
            System.out.println(data.get(i));
        }
    }
    catch(Exception e) {
      e.printStackTrace();
    }

The dependencies at runtime are

  • libthrift-0.9.0.jar
  • slf4j.api-1.6.1.jar
  • slf4j-simple-1.6.1.jar
  • ImpalaService.jar

See the test/build.sh script for the details.

The input parameters for the test are the Impala host and port and the hive/sql statement.

    java -cp $CLASSPATH org.ImpalaConnectTest.ImpalaConnectTest nceoricloud02 21000 "SELECT * FROM document LIMIT 5"

Building

Requirements:

  • thrift
  • ant

If you want to build the jar yourself, the build script downloads the necessary dependencies, generates the java code (using thrift 0.9.0) and compiles into a jar. It does the same for the test.

TODO: Use maven so that the project can easily be imported in clojure / clojar. TODO: Build JDBC driver connecting directly to Impala

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].