Description
I hit same error as HIVE-5847 and HIVE-10933. JDBC version is hive-jdbc-0.14.0.2.2.4.2-2-standalone.jar.
My test program as below:
/*************************************** test.java **********************************************/
import java.sql.SQLException;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;
import java.sql.DriverManager;
import java.lang.*;
import java.sql.DatabaseMetaData;
import java.sql.ResultSetMetaData;
public class test {
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://<hive_server_address>:10001/default", "hadoop", "");
Statement stmt = con.createStatement();
String tableName = "test";
stmt.execute("drop table if exists " + tableName);
stmt.execute("create table " + tableName + " (key varchar(10)) row format delimited fields terminated by '\t'");
ResultSet res = con.getMetaData().getColumns(null, "default", "test", null);
while (res.next())
}
}
Resutl
------------------
COLUMN_NAME: key
COLUMN_PRECISION: null