You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Fabian Hueske (JIRA)" <ji...@apache.org> on 2018/08/30 15:57:00 UTC

[jira] [Created] (FLINK-10263) User-defined function with LITERAL paramters yields CompileException

Fabian Hueske created FLINK-10263:
-------------------------------------

             Summary: User-defined function with LITERAL paramters yields CompileException
                 Key: FLINK-10263
                 URL: https://issues.apache.org/jira/browse/FLINK-10263
             Project: Flink
          Issue Type: Bug
          Components: Table API &amp; SQL
    Affects Versions: 1.7.0
            Reporter: Fabian Hueske
            Assignee: Timo Walther


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

{code}
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
	}
}
{code}

results in 

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

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



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)