deniskuzZ commented on code in PR #5613: URL: https://github.com/apache/hive/pull/5613#discussion_r1941870009
########## ql/src/java/org/apache/hadoop/hive/ql/parse/ParseUtils.java: ########## @@ -786,6 +786,6 @@ private static Map<String, TypeInfo> collectStructFieldNames(ASTNode structTypeN * @param node the ASTNode */ public static String getNodeName(ASTNode node) { - return node == null ? "" : node.getText().substring("TOK_".length()); + return node == null || node.getText() == null ? "" : node.getText().substring("TOK_".length()); Review Comment: how about ```` return Optional.ofNullable(node) .map(ASTNode::getText).map(text -> text.substring("TOK_".length())) .orElse(""); } ```` -- 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. To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org 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