phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aertoria <...@git.apache.org>
Subject [GitHub] phoenix pull request #292: PHOENIX-4231: Support restriction of remote UDF l...
Date Tue, 20 Feb 2018 04:07:12 GMT
Github user aertoria commented on a diff in the pull request:

    https://github.com/apache/phoenix/pull/292#discussion_r169213703
  
    --- Diff: phoenix-core/src/it/java/org/apache/phoenix/end2end/UserDefinedFunctionsIT.java
---
    @@ -322,6 +327,99 @@ public void testDeleteJar() throws Exception {
             assertFalse(rs.next());
         }
     
    +    /**
    +     * Test adding jars from an HDFS URI.
    +     * @throws Exception
    +     */
    +    @Test
    +    public void testAddJarsFromHDFS() throws Exception {
    +        compileTestClass(MY_ARRAY_INDEX_CLASS_NAME, MY_ARRAY_INDEX_PROGRAM, 7);
    +        Statement stmt = driver.connect(url, EMPTY_PROPS).createStatement();
    +        // Note that we have already added all locally created UDF jars to the hbase.dynamic.jars.dir
directory
    +        ResultSet rs = stmt.executeQuery("list jars");
    +        int count = 0;
    +        while(rs.next()) {
    +            count++;
    +        }
    +        Path destJarPathOnHDFS = copyJarsFromDynamicJarsDirToDummyHDFSDir("myjar7.jar");
    +        stmt.execute("delete jar '"+ util.getConfiguration().get(QueryServices.DYNAMIC_JARS_DIR_KEY)+"/"+"myjar7.jar'");
    +        stmt.execute("add jars '" + destJarPathOnHDFS.toString() + "'");
    +        rs = stmt.executeQuery("list jars");
    +        int finalCount = 0;
    +        while(rs.next()) {
    +            finalCount++;
    +        }
    +        assertEquals(count, finalCount);
    --- End diff --
    
    original `list jars` equal to `list jars`, shouldn't the newly added jar make it plus
1? i.e.,
     assertEquals(count+1, finalCount);


---

Mime
View raw message