Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-2263

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Cannot Reproduce
    • 0.5.0, 0.7.1
    • None
    • JDBC
    • None
    • 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;
          }
        }
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            rohithsharma Rohith Sharma K S
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: