Hello Team, I am getting below error while running...
# troubleshooting
k
Hello Team, I am getting below error while running basic Table API job. Caused by: java.lang.ClassCastException: class org.codehaus.janino.CompilerFactory cannot be cast to class org.codehaus.commons.compiler.ICompilerFactory (org.codehaus.janino.CompilerFactory is in unnamed module of loader org.apache.flink.util.ChildFirstClassLoader @c5e6dec; org.codehaus.commons.compiler.ICompilerFactory is in unnamed module of loader ‘app’) at org.codehaus.commons.compiler.CompilerFactoryFactory.getCompilerFactory(CompilerFactoryFactory.java:129) at org.codehaus.commons.compiler.CompilerFactoryFactory.getDefaultCompilerFactory(CompilerFactoryFactory.java:79) at org.apache.calcite.rel.metadata.JaninoRelMetadataProvider.compile(JaninoRelMetadataProvider.java:161)
Below is the POM file of my Job <!-- https://mvnrepository.com/artifact/org.apache.flink/flink-streaming-java --> <dependency> <groupId>org.apache.flink</groupId> <artifactId>flink-streaming-java</artifactId> <version>1.17.1</version> <scope>provided</scope> </dependency> <!-- https://mvnrepository.com/artifact/org.apache.flink/flink-streaming-java --> <dependency> <groupId>org.apache.flink</groupId> <artifactId>flink-streaming-java</artifactId> <version>1.17.1</version> <scope>provided</scope> </dependency> <!-- https://mvnrepository.com/artifact/org.apache.flink/flink-table-api-java-bridge --> <dependency> <groupId>org.apache.flink</groupId> <artifactId>flink-table-api-java-bridge</artifactId> <version>1.17.1</version> <scope>provided</scope> </dependency> <!-- https://mvnrepository.com/artifact/org.apache.flink/flink-table-api-scala --> <dependency> <groupId>org.apache.flink</groupId> <artifactId>flink-table-api-scala_2.12</artifactId> <version>1.17.1</version> </dependency> <!-- https://mvnrepository.com/artifact/org.apache.flink/flink-table-api-java-bridge --> <dependency> <groupId>org.apache.flink</groupId> <artifactId>flink-table-api-java-bridge</artifactId> <version>1.17.1</version> <scope>provided</scope> </dependency> <!-- https://mvnrepository.com/artifact/org.apache.flink/flink-table-api-scala-bridge --> <dependency> <groupId>org.apache.flink</groupId> <artifactId>flink-table-api-scala-bridge_2.12</artifactId> <version>1.17.1</version> </dependency> <!-- https://mvnrepository.com/artifact/org.projectlombok/lombok --> <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <version>1.18.28</version> <scope>provided</scope> </dependency>
s
There is a package that is missing in your POM file. Can you try including the
flink-table-planner-loader
package in POM and check whether the exception still persists.
Copy code
<dependency>
    <groupId>org.apache.flink</groupId>
    <artifactId>flink-table-planner-loader</artifactId>
    <version>1.17.1</version>
    <scope>test</scope>
</dependency>
m
k
@Martijn Visser It works for me Thank you so much I have one more concern, I have Flink Job that is using Table API, Input log in the Flink Job has a diff log schema, let’s say log1 has {x=1,y=“abc”,z=true} log2 has {x=1,a=“yu”,b=false} in future I can have other fields As far as I have explored I need fix schema, But in this example I can not make schema correct, So how can I make dynamic schema on the each rule? Thank you so much, I highly appreciate your reply