[
https://issues.apache.org/jira/browse/HIVE-9322?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14329443#comment-14329443
]
Ashutosh Chauhan commented on HIVE-9322:
----------------------------------------
I see, changes are concerned with read side only. I think it makes sense to
have this null check, incase underlying map implementation changes for these
OIs. Problem is java's map interface which most of OIs uses is lax about nulls
as keys. As a data point, HashMap allows it while ConcurrentHashMap doesnt
(throws NPE). Since keys here is provided by user its better that Hive returns
null in those cases, instead of throwing NPE. Performance consideration is
secondary, we should be concentrating on what semantics we want to provide to
users.
+1
> Make null-checks consistent for MapObjectInspector subclasses.
> --------------------------------------------------------------
>
> Key: HIVE-9322
> URL: https://issues.apache.org/jira/browse/HIVE-9322
> Project: Hive
> Issue Type: Bug
> Components: Serializers/Deserializers
> Affects Versions: 0.14.0
> Reporter: Mithun Radhakrishnan
> Assignee: Mithun Radhakrishnan
> Priority: Minor
> Attachments: HIVE-9322.1.patch
>
>
> {{LazyBinaryMapObjectInspector}}, {{DeepParquetHiveMapInspector}}, etc. check
> both the map-column value and the map-key for null, before dereferencing
> them. {{OrcMapObjectInspector}} and {{LazyMapObjectInspector}} do not.
> This patch brings them all in sync. Might not be a real problem, unless (for
> example) the lookup key is itself a (possibly null) value from another column.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)