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

BitSet not computed properly for ColumnBuffer subset

Log workAgile BoardRank to TopRank to BottomVotersWatch issueWatchersCreate sub-taskConvert to sub-taskMoveLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.3.0
    • Component/s: Hive, JDBC
    • Labels:
      None

      Description

      Hive decimal type column precision is returning as zero, even though column has precision set.
      Example: col67 decimal(18,2) scale is returning as zero for that column.

      Tried with below program.

         System.out.println("Opening connection");   Class.forName("org.apache.hive.jdbc.HiveDriver");
         Connection con = DriverManager.getConnection("jdbc:hive2://x.x.x.x:10000/default");
        DatabaseMetaData dbMeta = con.getMetaData();
         ResultSet rs = dbMeta.getColumns(null, "DEFAULT", "data_type_test",null);
      
       while (rs.next()) {
      
      if (rs.getString("COLUMN_NAME").equalsIgnoreCase("col48") || rs.getString("COLUMN_NAME").equalsIgnoreCase("col67") || rs.getString("COLUMN_NAME").equalsIgnoreCase("col68") || rs.getString("COLUMN_NAME").equalsIgnoreCase("col122")){
           System.out.println(rs.getString("COLUMN_NAME") + "\t" + rs.getString("COLUMN_SIZE") + "\t" + rs.getInt("DECIMAL_DIGITS"));
          }
         }
      
         rs.close();
      
         con.close();
      
        } catch (Exception e) {
         e.printStackTrace();
         ;
        }
      

      Default fetch size is 50. if any column no is under 50 with decimal type, precision is returning properly, when the column no is greater than 50, scale is returning as zero.

        Attachments

        1. HIVE-15519.6.patch
          19 kB
          Rui Li
        2. HIVE-15519.5-branch-1.patch
          12 kB
          Rui Li
        3. HIVE-15519.4.patch
          19 kB
          Rui Li
        4. HIVE-15519.3.patch
          10 kB
          Rui Li
        5. HIVE-15519.2.patch
          10 kB
          Rui Li
        6. HIVE-15519.1.patch
          5 kB
          Rui Li
        7. data_type_test(1).txt
          8 kB
          Bharat Viswanadham

          Activity

          $i18n.getText('security.level.explanation', $currentSelection) Viewable by All Users
          Cancel

            People

            • Assignee:
              lirui Rui Li Assign to me
              Reporter:
              bharat Bharat Viswanadham

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment