hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yaqiong (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (HIVE-11753) DatabaseMetadata.getColumn returns precision 0 for varchar/decimal
Date Thu, 10 Sep 2015 09:59:45 GMT

     [ https://issues.apache.org/jira/browse/HIVE-11753?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Yaqiong resolved HIVE-11753.
----------------------------
       Resolution: Won't Fix
    Fix Version/s: 0.14.1

The issue was fixed in 0.14.1, however according to HIVE-5847, it was fixed in 0.14.0

> DatabaseMetadata.getColumn returns precision 0 for varchar/decimal
> ------------------------------------------------------------------
>
>                 Key: HIVE-11753
>                 URL: https://issues.apache.org/jira/browse/HIVE-11753
>             Project: Hive
>          Issue Type: Bug
>          Components: JDBC
>    Affects Versions: 0.14.0
>            Reporter: Yaqiong
>             Fix For: 0.14.1
>
>   Original Estimate: 96h
>  Remaining Estimate: 96h
>
> 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()) {
>       System.out.println("COLUMN_NAME: " + res.getString(4));
>       System.out.println("COLUMN_PRECISION: " + res.getString(7));
>     }
>   }
> }
> Resutl
> ------------------
> COLUMN_NAME: key
> COLUMN_PRECISION: null



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message