ngsg commented on PR #5556:
URL: https://github.com/apache/hive/pull/5556#issuecomment-2507000541
> The issue I encountered occurs when there are more than four window
functions in a Hive query, and the table and fields are very large. In such
cases, the "width is negative" error can arise. I am not sure if this
modification can fix the problem. However, when reviewing the source code, I
noticed an overflow issue in this area, so I made the changes accordingly.
Thank you for your feedback. Currently, I am not sure how to write a test case
for this scenario in Hive. Could you please guide me on which test class I can
refer to for writing related test cases?
You could add a query unit test by writing a query under
`ql/src/test/queries/clientpositive` and running the following maven command to
create its expected output.
```
mvn test -Pitests -Dtest=TestMiniLlapLocalCliDriver
-Dtest.output.overwrite=true -Dqfile=<query file name here>
```
Then the output will be created under `ql/src/test/results/clientpositive`.
For example, one can update the output of
`ql/src/test/queries/clientpositive/stats5.q` by running
`mvn test -Pitests -Dtest=TestMiniLlapLocalCliDriver
-Dtest.output.overwrite=true -Dqfile=stats5.q`. Then the command will rewrite
`ql/src/test/results/clientpositive/stats5.q.out`. `stats5.q` is a simple
qtest, so I think it could be a good example for understanding qtest.
Since your issue happens on very large tables, I think you need `alter table
<table name> update statistics set('numRows='...', 'rawDataSize'='...')`
commands to reproduce the issue with small tables. I also used this command to
check overflow.
You can find more resources about writing a test in the following page:
https://cwiki.apache.org/confluence/display/Hive/HowToContribute
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]