beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Luckey (JIRA)" <j...@apache.org>
Subject [jira] [Created] (BEAM-2369) HadoopFileSystem: NullPointerException on match of non existing resource
Date Fri, 26 May 2017 13:19:04 GMT
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)

Mime
View raw message