You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Arun Mahadevan (JIRA)" <ji...@apache.org> on 2018/07/13 00:02:00 UTC

[jira] [Created] (CALCITE-2413) RexToLixTranslator does not generate correct declaration of Methods with generic return types

Arun Mahadevan created CALCITE-2413:
---------------------------------------

             Summary: RexToLixTranslator does not generate correct declaration of Methods with generic return types
                 Key: CALCITE-2413
                 URL: https://issues.apache.org/jira/browse/CALCITE-2413
             Project: Calcite
          Issue Type: Bug
            Reporter: Arun Mahadevan
            Assignee: Julian Hyde


We have an user defined function like below:
{code:java}
public class Identity<I> implements Function<I, I> {
  @Override
  public I apply(I i) {
    return i;
  }
}
{code}

We have a projection that applies the function twice and then the generated statement contains the type parameter instead of a valid Java type.

{code:java}
final I v = new Identity().apply(current[0] == null ? (String) null : current[0].toString());
{code}

After tracing through the code for a while it looks like the MethodCallExpression uses Method.getGenericType. 

https://github.com/apache/calcite/blob/master/linq4j/src/main/java/org/apache/calcite/linq4j/tree/MethodCallExpression.java#L53

I guess this should be changed to Method.getReturnType instead.





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