java调用hive
来源:互联网 发布:域名服务器dns中存放 编辑:程序博客网 时间:2024/06/02 05:59
1 pom.xml
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-common</artifactId>
<version>2.7.2</version>
</dependency>
<dependency>
<groupId>org.apache.hive</groupId>
<artifactId>hive-jdbc</artifactId>
<version>2.1.0</version>
</dependency>
2 hive服务器
hive-site.xml 配置hive的认证方式
<property>
<name>hive.server2.authentication</name>
<value>NONE </value>
<description>
Expects one of [nosasl, none, ldap, kerberos, pam, custom].
Client authentication types.
NONE: no authentication check
LDAP: LDAP/AD based authentication
KERBEROS: Kerberos/GSSAPI authentication
CUSTOM: Custom authentication provider
(Use with property hive.server2.custom.authentication.class)
PAM: Pluggable authentication module
NOSASL: Raw transport
</description>
./hive2server &
netstat -nltp|grep 10000
3
StringdriverName="org.apache.hive.jdbc.HiveDriver";
try{
Class.forName(driverName);
Connectioncon= DriverManager.getConnection(
"jdbc:hive2://192.168.1.126:10000/default","",
"");
Statementstmt=con.createStatement();
Stringsql=" select * from hbt_sampleinfo where key='0000012113af115dfb3c0adcffaacb98'";
System.out.println("Running: " +sql);
ResultSetres=stmt.executeQuery(sql);
if(res.next()) {
System.out.println(res.getString(1));
System.out.println(res.getString(2));
System.out.println(res.getString(3));
}
}catch(ClassNotFoundExceptione) {
e.printStackTrace();
System.exit(1);
}
阅读全文
0 0
- java调用hive api
- java调用hive
- Java 调用Hive 自定义UDF
- Java调用Hive的操作
- Hive调用Java类ReflectUDF
- Java 调用Hive 自定义UDF
- JAVA编写客户的调用HIVE
- java调用hive时必须启动hiveserver
- node.js调用Java接口连接hive
- hive 调用java的函数和科学记数法转换
- java程序调用hive查询的一个异常
- Hive安装配置使用及java api调用
- Java api 调用Sqoop2进行MySQL-->Hive的数据同步
- Hive安装配置使用及java api调用
- hive 调用栈
- hive jdbc 调用
- 利用crontab 调用hive
- hive java
- 今晚19:30直播阿里巴巴大规模持续集成的技术演进之路_欢迎免费观看
- U盘文件系统FAT32、exFAT、NTFS之间有什么区别?
- 流式大数据处理的三种框架:Storm,Spark和Samz
- 文章标题
- JavaScript——计算两个时间间隔的分钟数
- java调用hive
- github中添加公钥
- STM32 CUBE HAL库 HAL_GPIO_EXTI_IRQHandler
- 自动化测试工具
- App Widgets 详解二 Configuration Activity
- MFC中Rich Edit 2.0 控件中字体不一致的问题
- 欢迎使用CSDN-markdown编辑器
- 【LeetCode】312. Burst Balloons爆破气球得到最大金币数
- spring cloud 微服务框架 第三天