zabetak opened a new pull request #1424:
URL: https://github.com/apache/hive/pull/1424


   ### What changes were proposed in this pull request?
   
   1. Drop the defensive copy of children inside ASTNode#getChildren.
   2. Protect clients by accidentally modifying the list via an
   unmodifiable collection.
   
   ### Why are the changes needed?
   Profiling shows the vast majority of time spend on creating defensive
   copies of the node expression list inside ASTNode#getChildren.
   
   The method is called extensively from various places in the code
   especially those walking over the expression tree so it needs to be
   efficient.
   
   Most of the time creating defensive copies is not necessary. For those
   cases (if any) that the list needs to be modified clients should perform
   a copy themselves.
   
   ### Does this PR introduce _any_ user-facing change?
   No
   
   ### How was this patch tested?
   The test was added in a separate branch since it is not meant to be 
committed upstream for the following reasons:
   
   - the query for reproducing the problem takes up a few MBs
   - requires some changes in the default configurations.
   
   If you want to run the test run the following commands: 
   ```
   git checkout -b HIVE-24031-TEST master
   git pull [email protected]:zabetak/hive.git HIVE-24031-PLUS-TEST
   mvn clean install -DskipTests
   cd itests
   mvn clean install -DskipTests
   cd qtest
   mvn test -Dtest=TestMiniLlapLocalCliDriver 
-Dqfile=big_query_with_array_constructor.q -Dtest.output.overwrite
   ```


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to