commit 9148dad5dce7297f585bcddf96d9b8ce71bcb246 Author: Mingzhu Liu Date: Wed Feb 26 14:53:27 2020 -0800 Fix NPE in SymbolicInputFormat diff --git a/ql/src/java/org/apache/hadoop/hive/ql/io/SymbolicInputFormat.java b/ql/src/java/org/apache/hadoop/hive/ql/io/SymbolicInputFormat.java index b534e35689..fe3a946066 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/io/SymbolicInputFormat.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/io/SymbolicInputFormat.java @@ -75,7 +75,12 @@ public void rework(HiveConf job, MapredWork work) throws IOException { while ((line = reader.readLine()) != null) { // no check for the line? How to check? // if the line is invalid for any reason, the job will fail. - FileStatus[] matches = fileSystem.globStatus(new Path(line)); + Path linePath = new Path(line); + FileStatus[] matches = linePath.getFileSystem(job).globStatus(linePath); + if (matches == null) { + throw new IOException("failed to glob for patten " + line + + ", filesystem: " + linePath.getFileSystem(job).getScheme()); + } for (FileStatus fileStatus : matches) { Path schemaLessPath = Path.getPathWithoutSchemeAndAuthority(fileStatus.getPath()); StringInternUtils.internUriStringsInPath(schemaLessPath);