StefanXiepj commented on a change in pull request #1209: URL: https://github.com/apache/hive/pull/1209#discussion_r451232462
########## File path: ql/src/java/org/apache/hadoop/hive/ql/stats/StatsUtils.java ########## @@ -1336,6 +1341,9 @@ public static long getSizeOfPrimitiveTypeArraysFromType(String colType, int leng */ public static long getSizeOfMap(StandardConstantMapObjectInspector scmoi) { Map<?, ?> map = scmoi.getWritableConstantValue(); + if (null == map || map.isEmpty()) { + return 0L; + } Review comment: Thanks for your review, maybe we can return it like this: ``` Map<?, ?> map = scmoi.getWritableConstantValue(); if (null == map || map.isEmpty()) { return JavaDataModel.get().hashMap(0); } ``` ---------------------------------------------------------------- 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: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org For additional commands, e-mail: gitbox-h...@hive.apache.org