Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
getLiteralList() in SearchArgumentImpl$PredicateLeafImpl returns null if dynamic values are not available.
@Override public List<Object> getLiteralList() { if (literalList != null && literalList.size() > 0 && literalList.get(0) instanceof LiteralDelegate) { List<Object> newLiteraList = new ArrayList<Object>(); try { for (Object litertalObj : literalList) { Object literal = ((LiteralDelegate) litertalObj).getLiteral(); if (literal != null) { newLiteraList.add(literal); } } } catch (NoDynamicValuesException err) { LOG.debug("Error while retrieving literalList, returning null", err); return null; } return newLiteraList; } return literalList; }
There are multiple call sites where the return value is used without a null check. E.g: leaf.getLiteralList().stream().
The return null was added as part of HIVE-18827 to avoid having an unimportant warning message when dynamic values have not been delivered yet.
sershe, jdere, I propose return an empty list instead of null in a case like this. What do you think?