Hive
  1. Hive
  2. HIVE-2263

Wrong value is retrieved by ResultSet.getColumnDisplaySize() for SMALLINT and FLOAT Datatype

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 0.5.0, 0.7.1
    • Fix Version/s: None
    • Component/s: JDBC
    • Labels:
      None
    • Environment:

      Linux. Hadoop-20.1 and Hive-0.7.1

      Description

      1).Create a table with smallint datatype.
      create table test(a smallint,b int,c bigint);
      2).ResultSet result = select a,b,c from test;
      3) When I Try to get the getColumnDisplaySize()for the columns,
      i.e ResultSet.getColumnDisplaySize(a) is 32 (default vaule )
      ResultSet.getColumnDisplaySize(b) is 16
      ResultSet.getColumnDisplaySize(c) is 32

      But in the code, default is returning.

      public int getColumnDisplaySize(int column) throws SQLException {
          // taking a stab at appropriate values
          switch (getColumnType(column)) {
          case Types.VARCHAR:
          case Types.BIGINT:
            return 32;
          case Types.TINYINT:
            return 2;
          case Types.BOOLEAN:
            return 8;
          case Types.DOUBLE:
          case Types.INTEGER:
            return 16;
          default:
            return 32;
          }
        }
      

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Unassigned
            Reporter:
            Rohith Sharma K S
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:

              Development