Csaba Juhász created HIVE-28273:
-----------------------------------

             Summary: Test data generation failure in HIVE-28249 related tests
                 Key: HIVE-28273
                 URL: https://issues.apache.org/jira/browse/HIVE-28273
             Project: Hive
          Issue Type: Bug
            Reporter: Csaba Juhász
         Attachments: image-2024-05-22-19-11-35-890.png

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.

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

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:


{code:java}
[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
{code}

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

 !image-2024-05-22-19-11-35-890.png! 




--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to