问题描述
我想创建一个黑斑羚表,使用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驱动程序。
请参照以下链接,这有一个样本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添加数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!