Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CALCITE-3745] UnitCompiler can not find required class information. #2433

Closed
wants to merge 3 commits into from
Closed

Conversation

birschick-bq
Copy link
Contributor

@birschick-bq birschick-bq commented Jun 10, 2021

https://issues.apache.org/jira/browse/CALCITE-3745

  • Uses Calcite class loaders to ensure access to resource and included classes.
  • Updates to Janino 3.1.4

Note: Janino still has a bug which causes this to fail to load the factory class.
janino-compiler/janino#150
So we'll need to integrate with a future version (3.1.5) before merging this code.

Edit:
Janino pull request was merged. Awaiting release.

@gr4ve
@vlsi

@birschick-bq
Copy link
Contributor Author

Removing PR as the Janino compiler 3.1.3 and 3.1.4 cause Calcite unit tests to fail.

@vlsi
Copy link
Contributor

vlsi commented Jun 12, 2021

 Caused by: org.codehaus.commons.compiler.InternalCompilerException: Line 61, Column 17: org.codehaus.commons.compiler.InternalCompilerException: Operand stack underflow
                                        at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:2393)
                                        at org.codehaus.janino.UnitCompiler.access$1800(UnitCompiler.java:231)
                                        at org.codehaus.janino.UnitCompiler$6.visitExpressionStatement(UnitCompiler.java:1530)
                                        at org.codehaus.janino.UnitCompiler$6.visitExpressionStatement(UnitCompiler.java:1523)
                                        at org.codehaus.janino.Java$ExpressionStatement.accept(Java.java:3198)
                                        at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java:1523)
                                        at org.codehaus.janino.UnitCompiler.compileStatements(UnitCompiler.java:1607)
                                        at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:3531)
                                        at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java:3218)
                                        ... 75 more
                                        Caused by: org.codehaus.commons.compiler.InternalCompilerException: Operand stack underflow
                                            at org.codehaus.janino.StackMap.peekOperand(StackMap.java:94)
                                            at org.codehaus.janino.CodeContext.popOperand(CodeContext.java:1349)
                                            at org.codehaus.janino.UnitCompiler.putfield(UnitCompiler.java:12363)
                                            at org.codehaus.janino.UnitCompiler.compileSet2(UnitCompiler.java:6498)
                                            at org.codehaus.janino.UnitCompiler.access$13400(UnitCompiler.java:231)
                                            at org.codehaus.janino.UnitCompiler$20.visitFieldAccess(UnitCompiler.java:6480)
                                            at org.codehaus.janino.UnitCompiler$20.visitFieldAccess(UnitCompiler.java:6475)
                                            at org.codehaus.janino.Java$FieldAccess.accept(Java.java:4668)
                                            at org.codehaus.janino.UnitCompiler.compileSet(UnitCompiler.java:6475)
                                            at org.codehaus.janino.UnitCompiler.compileSet2(UnitCompiler.java:6489)
                                            at org.codehaus.janino.UnitCompiler.access$13200(UnitCompiler.java:231)
                                            at org.codehaus.janino.UnitCompiler$20.visitAmbiguousName(UnitCompiler.java:6478)
                                            at org.codehaus.janino.UnitCompiler$20.visitAmbiguousName(UnitCompiler.java:6475)
                                            at org.codehaus.janino.Java$AmbiguousName.accept(Java.java:4574)
                                            at org.codehaus.janino.UnitCompiler.compileSet(UnitCompiler.java:6475)
                                            at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:3992)
                                            at org.codehaus.janino.UnitCompiler.access$6000(UnitCompiler.java:231)
                                            at org.codehaus.janino.UnitCompiler$12.visitAssignment(UnitCompiler.java:3944)
                                            at org.codehaus.janino.UnitCompiler$12.visitAssignment(UnitCompiler.java:3924)
                                            at org.codehaus.janino.Java$Assignment.accept(Java.java:4835)
                                            at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java:3924)
                                            at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:2391)
                                            ... 83 more

It looks like an error that is worth reporting to janino.

@kuixiang
Copy link

select max(cast(ts as timestamp)) from database.table

with the same error...

update the janino to 3.1.6 will be ok~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants