[ https://issues.apache.org/jira/browse/FLINK-4252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15389003#comment-15389003 ]
Jark Wu edited comment on FLINK-4252 at 7/22/16 6:35 AM: --------------------------------------------------------- I debug it and find that we use {{Class.getCanonicalName}} to get the canonical name of the underlying class which will return null if the underlying class does not have a canonical name (i.e., if it is a local or anonymous class or an array whose component type does not have a canonical name). So you should move the {{Dandan}} case class definition out of the main function, and it should work. But I haven't found any document telling that we cannot define local case class, so I'm not sure whether it is a bug, [~fhueske] [~twalthr] what do you think? was (Author: jark): I debug it and find that we use {Class.getCanonicalName} to get the canonical name of the underlying class which will return null if the underlying class does not have a canonical name (i.e., if it is a local or anonymous class or an array whose component type does not have a canonical name). So you should move the {Dandan} case class definition out of the main function, and it should work. But I haven't found any document telling that we cannot define local case class, so I'm not sure whether it is a bug, [~fhueske] [~twalthr] what do you think? > Table program cannot be compiled > -------------------------------- > > Key: FLINK-4252 > URL: https://issues.apache.org/jira/browse/FLINK-4252 > Project: Flink > Issue Type: Bug > Components: Table API & SQL > Affects Versions: 1.1.0 > Environment: OS X EI Captain > scala 2.11.7 > jdk 8 > Reporter: Renkai Ge > Attachments: TestMain.scala > > > I'm trying the table apis. > I got some errors like this > My code is in the attachments > ------------------------------------------------------------ > The program finished with the following exception: > org.apache.flink.client.program.ProgramInvocationException: The program > execution failed: Job execution failed. > at > org.apache.flink.client.program.ClusterClient.run(ClusterClient.java:413) > at > org.apache.flink.client.program.StandaloneClusterClient.submitJob(StandaloneClusterClient.java:92) > at > org.apache.flink.client.program.ClusterClient.run(ClusterClient.java:389) > at > org.apache.flink.client.program.ClusterClient.run(ClusterClient.java:376) > at > org.apache.flink.client.program.ContextEnvironment.execute(ContextEnvironment.java:61) > at > org.apache.flink.api.java.ExecutionEnvironment.execute(ExecutionEnvironment.java:896) > at org.apache.flink.api.java.DataSet.collect(DataSet.java:410) > at org.apache.flink.api.java.DataSet.print(DataSet.java:1605) > at org.apache.flink.api.scala.DataSet.print(DataSet.scala:1672) > at TestMain$.main(TestMain.scala:31) > at TestMain.main(TestMain.scala) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:497) > at > org.apache.flink.client.program.PackagedProgram.callMainMethod(PackagedProgram.java:509) > at > org.apache.flink.client.program.PackagedProgram.invokeInteractiveModeForExecution(PackagedProgram.java:403) > at > org.apache.flink.client.program.ClusterClient.run(ClusterClient.java:331) > at > org.apache.flink.client.CliFrontend.executeProgram(CliFrontend.java:777) > at org.apache.flink.client.CliFrontend.run(CliFrontend.java:253) > at > org.apache.flink.client.CliFrontend.parseParameters(CliFrontend.java:1005) > at org.apache.flink.client.CliFrontend.main(CliFrontend.java:1048) > Caused by: org.apache.flink.runtime.client.JobExecutionException: Job > execution failed. > at > org.apache.flink.runtime.jobmanager.JobManager$$anonfun$handleMessage$1$$anonfun$applyOrElse$7.apply$mcV$sp(JobManager.scala:853) > at > org.apache.flink.runtime.jobmanager.JobManager$$anonfun$handleMessage$1$$anonfun$applyOrElse$7.apply(JobManager.scala:799) > at > org.apache.flink.runtime.jobmanager.JobManager$$anonfun$handleMessage$1$$anonfun$applyOrElse$7.apply(JobManager.scala:799) > at > scala.concurrent.impl.Future$PromiseCompletingRunnable.liftedTree1$1(Future.scala:24) > at > scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:24) > at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:41) > at > akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:401) > at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260) > at > scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.pollAndExecAll(ForkJoinPool.java:1253) > at > scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1346) > at > scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979) > at > scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107) > Caused by: java.lang.Exception: The user defined 'open(Configuration)' method > in class org.apache.flink.api.table.runtime.FlatMapRunner caused an > exception: Table program cannot be compiled. This is a bug. Please file an > issue. > at > org.apache.flink.runtime.operators.BatchTask.openUserCode(BatchTask.java:1337) > at > org.apache.flink.runtime.operators.chaining.ChainedFlatMapDriver.openTask(ChainedFlatMapDriver.java:47) > at > org.apache.flink.runtime.operators.BatchTask.openChainedTasks(BatchTask.java:1377) > at org.apache.flink.runtime.operators.BatchTask.run(BatchTask.java:471) > at > org.apache.flink.runtime.operators.BatchTask.invoke(BatchTask.java:351) > at org.apache.flink.runtime.taskmanager.Task.run(Task.java:584) > at java.lang.Thread.run(Thread.java:745) > Caused by: org.apache.flink.api.common.InvalidProgramException: Table program > cannot be compiled. This is a bug. Please file an issue. > at > org.apache.flink.api.table.runtime.FunctionCompiler$class.compile(FunctionCompiler.scala:37) > at > org.apache.flink.api.table.runtime.FlatMapRunner.compile(FlatMapRunner.scala:28) > at > org.apache.flink.api.table.runtime.FlatMapRunner.open(FlatMapRunner.scala:42) > at > org.apache.flink.api.common.functions.util.FunctionUtils.openFunction(FunctionUtils.java:38) > at > org.apache.flink.runtime.operators.BatchTask.openUserCode(BatchTask.java:1335) > ... 6 more > Caused by: org.codehaus.commons.compiler.CompileException: Line 46, Column > 11: Expression "null" is not a type > at org.codehaus.janino.Java$Located.throwCompileException(Java.java:111) > at > org.codehaus.janino.Java$Atom.toTypeOrCompileException(Java.java:2684) > at org.codehaus.janino.Parser.parseBlockStatement(Parser.java:1162) > at org.codehaus.janino.Parser.parseBlockStatements(Parser.java:1090) > at > org.codehaus.janino.Parser.parseMethodDeclarationRest(Parser.java:943) > at org.codehaus.janino.Parser.parseClassBodyDeclaration(Parser.java:569) > at org.codehaus.janino.Parser.parseClassBody(Parser.java:519) > at org.codehaus.janino.Parser.parseClassDeclarationRest(Parser.java:485) > at > org.codehaus.janino.Parser.parsePackageMemberTypeDeclaration(Parser.java:273) > at org.codehaus.janino.Parser.parseCompilationUnit(Parser.java:168) > at org.codehaus.janino.SimpleCompiler.cook(SimpleCompiler.java:201) > at org.codehaus.janino.SimpleCompiler.cook(SimpleCompiler.java:192) > at org.codehaus.commons.compiler.Cookable.cook(Cookable.java:84) > at org.codehaus.commons.compiler.Cookable.cook(Cookable.java:77) > at > org.apache.flink.api.table.runtime.FunctionCompiler$class.compile(FunctionCompiler.scala:34) > ... 10 more > ----------------- -- This message was sent by Atlassian JIRA (v6.3.4#6332)