Alessandro Solimando created HIVE-25749: -------------------------------------------
Summary: Check if RelMetadataQuery.collations() return null to avoid NPE Key: HIVE-25749 URL: https://issues.apache.org/jira/browse/HIVE-25749 Project: Hive Issue Type: Bug Components: CBO, Query Planning Affects Versions: 4.0.0 Reporter: Alessandro Solimando Assignee: Alessandro Solimando Accoring to "RelMetadataQuery.collations()" [javadoc|https://github.com/apache/calcite/blob/calcite-1.25.0/core/src/main/java/org/apache/calcite/rel/metadata/RelMetadataQuery.java#L537], the method can return "null" if collactions information are not available. Hive invokes the method in two places ([RelFieldTrimmer|https://github.com/apache/hive/blob/1046f41ea36ab3c8b036481128ba9b76dda2882a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/RelFieldTrimmer.java#L192] and [HiveJoin|https://github.com/apache/hive/blob/1046f41ea36ab3c8b036481128ba9b76dda2882a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/reloperators/HiveJoin.java#L206]), but it does not check for "null" return values, which can cause NPE. -- This message was sent by Atlassian Jira (v8.20.1#820001)