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:

    --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/ImportGrabber.java
    @@ -63,9 +62,21 @@ public void traverseStaticImportOnDemandDeclaration(StaticImportOnDemandDeclarat
    -  public static List<String> getMethods(Java.CompilationUnit cu){
    -    ImportGrabber visitor = new ImportGrabber();
    -    cu.getPackageMemberTypeDeclarations()[0].accept(visitor.finder.comprehensiveVisitor());
    +  /**
    +   * Creates list of imports that are present in compilation unit.
    +   * For example:
    +   * [import io.netty.buffer.DrillBuf;, import org.apache.drill.exec.expr.DrillSimpleFunc;]
    +   *
    +   * @param compilationUnit compilation unit
    +   * @return list of imports
    +   */
    +  public static List<String> getImports(Java.CompilationUnit compilationUnit){
    --- End diff --
    When writing code for UDFs, we recommend users to use the fully qualified class names
instead of imports.
    What if we enhance our UDFs generation code to use imports from function class? This way,
fully qualified class names usage won't be required. Since I thought it could be used for
future enhancement, I have left `ImportGrabber`.

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.

View raw message