You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by "Luke Cwik (JIRA)" <ji...@apache.org> on 2017/05/26 23:28:04 UTC

[jira] [Assigned] (BEAM-2369) HadoopFileSystem: NullPointerException on match of non existing resource

     [ https://issues.apache.org/jira/browse/BEAM-2369?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Luke Cwik reassigned BEAM-2369:
-------------------------------

    Assignee: Michael Luckey  (was: Davor Bonaci)

> 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-extensions
>    Affects Versions: 2.0.0
>            Reporter: Michael Luckey
>            Assignee: Michael Luckey
>             Fix For: 2.1.0
>
>
> 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)