Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-10263

User-defined function with LITERAL paramters yields CompileException

    Details

      Description

      When using a user-defined scalar function only with literal parameters, a CompileException is thrown. For example

      SELECT myFunc(CAST(40.750444 AS FLOAT), CAST(-73.993475 AS FLOAT))
      
      public class MyFunc extends ScalarFunction {
      
      	public int eval(float lon, float lat) {
      		// do something
      	}
      }
      

      results in

      [ERROR] Could not execute SQL statement. Reason:
      org.codehaus.commons.compiler.CompileException: Line 5, Column 10: Cannot determine simple type name "com"
      

      The problem is probably caused by the expression reducer because it disappears if a regular attribute is added to a parameter expression.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                twalthr Timo Walther
                Reporter:
                fhueske Fabian Hueske
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: