You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "feng.huang (Jira)" <ji...@apache.org> on 2021/03/02 05:42:00 UTC

[jira] [Created] (CALCITE-4518) org.codehaus.commons.compiler.CompileException

feng.huang created CALCITE-4518:
-----------------------------------

             Summary: org.codehaus.commons.compiler.CompileException
                 Key: CALCITE-4518
                 URL: https://issues.apache.org/jira/browse/CALCITE-4518
             Project: Calcite
          Issue Type: Bug
            Reporter: feng.huang


calcite call janino to compile javacode in some case such as ReduceExpressionsRule#reduceExpressions, but there is something wrong with janino handling "<" operator.

 
{code:java}
public static void main(String[] args) throws IOException, CompileException {

    String code = "public Object[] apply(Object root0) {\n" +
            "int a=1;int b=2 ; " +
            "return new Object[]{a < b,1,2};\n" +
            "}\n";
    final ClassBodyEvaluator cbe = new ClassBodyEvaluator();
    cbe.setClassName("Test");
    cbe.setExtendedClass(Utilities.class);
    cbe.setImplementedInterfaces(new Class[]{Function1.class, Serializable.class});
    cbe.setParentClassLoader(RexExecutable.class.getClassLoader());
    cbe.cook(new Scanner(null, new StringReader(code)));
}{code}
 

 

when janino read "a < b , " , it regard this as the instance of rule : ShiftExpression<TypeArgument,TypeArgument...>.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)