Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-14055 Add advanced function DDL syntax "USING JAR"
  3. FLINK-29035

ExpressionReducer does not work with jar resources

    XMLWordPrintableJSON

Details

    Description

      It seems the code generation for expression reduction uses an invalid class loader that does not contain the jar resource.

      Reproducible example:

      
      CREATE TEMPORARY SYSTEM FUNCTION myLower AS '%s' USING JAR '%s'
      
      SELECT myLower('HELLO')
      
      

       

      fails with

      
      java.lang.RuntimeException: Could not instantiate generated class 'ExpressionReducer$4'
      
          at org.apache.flink.table.runtime.generated.GeneratedClass.newInstance(GeneratedClass.java:74)
          at org.apache.flink.table.planner.codegen.ExpressionReducer.reduce(ExpressionReducer.scala:97)
          at org.apache.calcite.rel.rules.ReduceExpressionsRule.reduceExpressionsInternal(ReduceExpressionsRule.java:759)
          at org.apache.calcite.rel.rules.ReduceExpressionsRule.reduceExpressions(ReduceExpressionsRule.java:699)
          at org.apache.calcite.rel.rules.ReduceExpressionsRule$ProjectReduceExpressionsRule.onMatch(ReduceExpressionsRule.java:306)
      
      
      Caused by: org.apache.flink.api.common.InvalidProgramException: Table program cannot be compiled. This is a bug. Please file an issue.
      
      Caused by: org.codehaus.commons.compiler.CompileException: Line 13, Column 37: Cannot determine simple type name "LowerUDF46"
          at org.codehaus.janino.UnitCompiler.compileError(UnitCompiler.java:12211)
          at org.codehaus.janino.UnitCompiler.getReferenceType(UnitCompiler.java:6833)
      
      

      Attachments

        Issue Links

          Activity

            People

              lsy dalongliu
              twalthr Timo Walther
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: