You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by "Michael Luckey (JIRA)" <ji...@apache.org> on 2017/05/26 13:19:04 UTC
[jira] [Created] (BEAM-2369) HadoopFileSystem: NullPointerException
on match of non existing resource
Michael Luckey created BEAM-2369:
------------------------------------
Summary: HadoopFileSystem: NullPointerException on match of non existing resource
Key: BEAM-2369
URL: https://issues.apache.org/jira/browse/BEAM-2369
Project: Beam
Issue Type: Bug
Components: sdk-java-core
Affects Versions: 2.0.0
Reporter: Michael Luckey
Assignee: Davor Bonaci
Testcase:
{code}
@Test
public void testMatchForNonExistentFile() throws Exception {
create("testFileAA", "testDataAA".getBytes());
// ensure files exist
assertArrayEquals("testDataAA".getBytes(), read("testFileAA"));
List<MatchResult> matchResults = fileSystem.match(
ImmutableList.of(testPath("testFileA").toString()));
assertEquals(Status.NOT_FOUND, Iterables.getOnlyElement(matchResults).status());
}
{code}
throws NullPointerException
{noformat}
java.lang.NullPointerException
at org.apache.beam.sdk.io.hdfs.HadoopFileSystem.match(HadoopFileSystem.java:87)
at org.apache.beam.sdk.io.hdfs.HadoopFileSystemTest.testMatchForNonExistentFile(HadoopFileSystemTest.java:187)
{noformat}
as the underlying hadoop implementation returns null:
{noformat}
* When the input pattern "looks" like just a simple filename, and we
* can't find it, we return null rather than an empty array.
* This is a special case which the shell relies on.
{noformat}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)