drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arina-ielchiieva <...@git.apache.org>
Subject [GitHub] drill pull request #843: DRILL-5533: Fix flag assignment in FunctionInitiali...
Date Wed, 24 May 2017 08:21:53 GMT
Github user arina-ielchiieva commented on a diff in the pull request:

    https://github.com/apache/drill/pull/843#discussion_r118184323
  
    --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/FunctionInitializer.java
---
    @@ -119,33 +117,35 @@ private void checkInit() {
         }
       }
     
    -  private CompilationUnit get(Class<?> c) throws IOException {
    -    String path = c.getName();
    +  /**
    +   * Using class name generates path to class source code (*.java),
    +   * reads its content as string and parses it into {@link org.codehaus.janino.Java.CompilationUnit}.
    +   *
    +   * @param clazz function class
    +   * @return compilation unit
    +   * @throws IOException if did not find class or could not load it
    +   */
    +  public CompilationUnit convertToCompilationUnit(Class<?> clazz) throws IOException
{
    +    String path = clazz.getName();
         path = path.replaceFirst("\\$.*", "");
         path = path.replace(".", FileUtils.separator);
         path = "/" + path + ".java";
    -    CompilationUnit cu = functionUnits.get(path);
    -    if (cu != null) {
    -      return cu;
    -    }
     
    -    try (InputStream is = c.getResourceAsStream(path)) {
    +    logger.debug("Loading function code from the {}", path);
    --- End diff --
    
    Done.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message