黑斑羚创建表,并用java添加数据 [英] Create impala table and add data using java

查看:220
本文介绍了黑斑羚创建表,并用java添加数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个黑斑羚表,使用Java数据添加到它。

I am trying to create an impala table and add data into it using java.

1)我应该如何为黑斑羚连接?

1.) How should I create connection for impala?

2。)我​​可以直接创建一个黑斑羚表或者我应该创建一个蜂巢表,并用黑斑羚访问它?

2.) Can I create an impala table directly or should I create a hive table and access it using impala?

Java程序或code片段会有所帮助。

A java program or code snippets will help.

推荐答案

您可以使用黑斑羚JDBC驱动程序。

请参照以下<一个href=\"https://github.com/onefoursix/Cloudera-Impala-JDBC-Example/blob/impala-cdh-5.1.0/src/main/java/com/cloudera/example/ClouderaImpalaJdbcExample.java\"相对=nofollow>链接,这有一个样本code使用JDBC驱动程序连接黑斑羚

Refer the following link , this has a sample code for the impala connection using the jdbc driver.

有关在黑斑羚创建一个表,你可以把它作为一个查询,neednot做在蜂巢。如果您添加/创建配置单元表,那么你需要在因帕拉无效的元数据,以反映黑斑羚表的详细信息。

For creating a table in impala you could pass it as a query, neednot do it in hive. In case you add/create a table in hive then you need to invalidate metadata in impala so as to reflect the table details in impala.

这篇关于黑斑羚创建表,并用java添加数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆