相关疑难解决方法(0)

必需字段'client_protocol'未设置

我正在使用Hive 0.12,我正在尝试从apache中获取JDBC.当我尝试运行代码时,我得到apache.thrift.TApplicationException.

import java.sql.SQLException;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;
import java.sql.DriverManager;

public class HiveJdbcClient {
private static String driverName = "org.apache.hive.jdbc.HiveDriver";

/**
 * @param args
 * @throws SQLException
 */
public static void main(String[] args) throws SQLException {
    try {
        Class.forName(driverName);
    } catch (ClassNotFoundException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
        System.exit(1);
    }
    //replace "hive" here with the name of the user the queries should run as
    Connection con =      DriverManager.getConnection("jdbc:hive2://localhost:10000/default", "hive", "");
    Statement stmt = con.createStatement();
    String tableName …
Run Code Online (Sandbox Code Playgroud)

java hadoop hive jdbc

19
推荐指数
2
解决办法
3万
查看次数

标签 统计

hadoop ×1

hive ×1

java ×1

jdbc ×1