Github user merlintang commented on the issue:

    https://github.com/apache/spark/pull/19885
  
    I have added this test case for the URI comparing based on Steve's 
comments. I have tested this in my local vm, it pass the test. 
    
    meanwhile, for the hdfs://namenode1/path1 hdfs://namenode1:8020/path2  , 
the default port number of hdfs can be got. thus, they also matched. 
    
    below is the test case:
    
    test("compare URI for filesystem") {
    
        //case 1
        var srcUri = new URI("file:///file1")
        var dstUri = new URI("file:///file2")
        assert(Client.compareUri(srcUri, dstUri) == true)
    
        //case 2
        srcUri = new URI("file:///c:file1")
        dstUri = new URI("file://c:file2")
        assert(Client.compareUri(srcUri, dstUri) == true)
    
        //case 3
        srcUri = new URI("file://host/file1")
        dstUri = new URI("file://host/file2")
        assert(Client.compareUri(srcUri, dstUri) == true)
    
        //case 4
        srcUri = new URI("wasb://bucket1@user")
        dstUri = new URI("wasb://bucket1@user/")
        assert(Client.compareUri(srcUri, dstUri) == true)
    
        //case 5
        srcUri = new URI("hdfs:/path1")
        dstUri = new URI("hdfs:/path2")
        assert(Client.compareUri(srcUri, dstUri) == true)
    
        //case 6
        srcUri = new URI("file:///file1")
        dstUri = new URI("file://host/file2")
        assert(Client.compareUri(srcUri, dstUri) == false)
    
        //case 7
        srcUri = new URI("file://host/file1")
        dstUri = new URI("file:///file2")
        assert(Client.compareUri(srcUri, dstUri) == false)
    
        //case 8
        srcUri = new URI("file://host/file1")
        dstUri = new URI("file://host2/file2")
        assert(Client.compareUri(srcUri, dstUri) == false)
    
        //case 9
        srcUri = new URI("wasb://bucket1@user")
        dstUri = new URI("wasb://bucket2@user/")
        assert(Client.compareUri(srcUri, dstUri) == false)
    
        //case 10
        srcUri = new URI("wasb://bucket1@user")
        dstUri = new URI("wasb://bucket1@user2/")
        assert(Client.compareUri(srcUri, dstUri) == false)
    
        //case 11
        srcUri = new URI("s3a://user@pass:bucket1/")
        dstUri = new URI("s3a://user2@pass2:bucket1/")
        assert(Client.compareUri(srcUri, dstUri) == false)
    
        //case 12
        srcUri = new URI("hdfs://namenode1/path1")
        dstUri = new URI("hdfs://namenode1:8080/path2")
        assert(Client.compareUri(srcUri, dstUri) == false)
    
        //case 13
        srcUri = new URI("hdfs://namenode1:8020/path1")
        dstUri = new URI("hdfs://namenode1:8080/path2")
        assert(Client.compareUri(srcUri, dstUri) == false)
      }
    



---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to