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

User-defined function with LITERAL paramters yields CompileException

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

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

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment