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

Test data generation failure in HIVE-28249 related tests

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 4.1.0
    • None

    Description

      generateJulianLeapYearTimestamps and generateJulianLeapYearTimestamps28thFeb are throwing NegativeArraySizeException once the base value equals or is over 999

      This is caused by the below code, supplying a negative value (when digits return a value larger than 4) to zeros, which in turn is used to create a new char array.

      StringBuilder sb = new StringBuilder(29);
      int year = ((i % 9999) + 1) * 100;
      sb.append(zeros(4 - digits(year)));
      

      When the tests are run using maven, the error in the generation function is caught but never rethrown or reported and the build is reported successful. For example running
      TestParquetTimestampsHive2Compatibility#testWriteHive2ReadHive4UsingLegacyConversionWithJulianLeapYearsFor28thFeb has the result:

      [INFO] -------------------------------------------------------
      [INFO]  T E S T S
      [INFO] -------------------------------------------------------
      [INFO] Running org.apache.hadoop.hive.ql.io.parquet.serde.TestParquetTimestampsHive2Compatibility
      [INFO] Tests run: 396, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.723 s - in org.apache.hadoop.hive.ql.io.parquet.serde.TestParquetTimestampsHive2Compatibility
      [INFO] 
      [INFO] Results:
      [INFO] 
      [INFO] Tests run: 396, Failures: 0, Errors: 0, Skipped: 0
      
      ...
      
      [INFO] BUILD SUCCESS
      

      When the test is run through an IDE (eg VSCode), the failure is reported properly.

      Attachments

        1. image-2024-05-22-19-11-35-890.png
          203 kB
          Csaba Juhász

        Issue Links

          Activity

            People

              Csaba Csaba Juhász
              Csaba Csaba Juhász
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: