kasakrisz opened a new pull request #2372:
URL: https://github.com/apache/hive/pull/2372


   ### What changes were proposed in this pull request?
   1. Create and setup `HiveDefaultRelMetadataProvider` before the first call 
of `HiveRelFieldTrimmer`.
   2. Invalidate the metadata query on the current `RelOptCluster` instance to 
trigger the newly set MetadataQuery instantiation.
   
   ### Why are the changes needed?
   `HiveRelFieldTrimmer` uses `RelMetadataProvider` to get expression lineage. 
If the query contains several union operators determining expression lineage 
can result into exponential number of expressions due to UNIONs which can lead 
to OOM.
   We already have a fix for this issue but prior this patch the fix was not 
used because it is part of `HiveDefaultRelMetadataProvider` which is not used 
when `HiveRelFieldTrimmer` was called the first time.
   
   ### Does this PR introduce _any_ user-facing change?
   No.
   
   ### How was this patch tested?
   It is not straight forward to repro this issue from q tests since the 
RelMetadataProvider is stored in a ThreadLocal instance and the ddl statements 
prior the failing query initializes MD provider with the Hive version. 
   To avoid this I setup a small cluster with Hive, Hadoop and Tez.


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