Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
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
Attachments
Issue Links
- is caused by
-
HIVE-28249 Parquet legacy timezone conversion converts march 1st to 29th feb and fails with not a leap year exception
- Resolved
- links to