rajkrrsingh opened a new pull request #1460:
URL: https://github.com/apache/hive/pull/1460
### What changes were proposed in this pull request?
Following query will trigger the getPartitionsByExpr call at HMS, HMS will
try to evaluate the filter based on the PartitionExpressionForMetastore proxy,
this proxy uses the QL packages to evaluate the filter and call
GenericUDFToUnixTimeStamp.
select * from table_name where hour between
from_unixtime(unix_timestamp('2020090120', 'yyyyMMddHH') - 1*60*60,
'yyyyMMddHH') and from_unixtime(unix_timestamp('2020090122', 'yyyyMMddHH') +
2*60*60, 'yyyyMMddHH');
I think SessionState in the code path will always be NULL thats why it hit
the NPE. to avoid NPE I will be checking if SessionState is null and based on
that will initialize it.
### Why are the changes needed?
This is BUG when SessionState is accessed in HMS.
### Does this PR introduce _any_ user-facing change?
No
### How was this patch tested?
I tried apply the changes on my local repro and it worked as expected.
----------------------------------------------------------------
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]