You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2015/10/02 11:18:26 UTC

[jira] [Commented] (FLINK-2642) Scala Table API crashes when executing word count example

    [ https://issues.apache.org/jira/browse/FLINK-2642?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14940935#comment-14940935 ] 

ASF GitHub Bot commented on FLINK-2642:
---------------------------------------

GitHub user twalthr opened a pull request:

    https://github.com/apache/flink/pull/1209

    [FLINK-2642] [table] Scala Table API crashes when executing word count example

    This PR improves the checking of the types during table translation. The error message for [FLINK-2642] is now correct.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/twalthr/flink TableApiWCFix

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/flink/pull/1209.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1209
    
----
commit 75b2a111729e5a97573e86b64bacf9496bde8a4c
Author: twalthr <tw...@apache.org>
Date:   2015-10-02T09:12:01Z

    [FLINK-2642] [table] Scala Table API crashes when executing word count example

----


> Scala Table API crashes when executing word count example
> ---------------------------------------------------------
>
>                 Key: FLINK-2642
>                 URL: https://issues.apache.org/jira/browse/FLINK-2642
>             Project: Flink
>          Issue Type: Bug
>          Components: Table API
>         Environment: current master (0.10)
>            Reporter: Jonas Traub
>            Assignee: Timo Walther
>
> I tried to run the examples provided in the documentation of Flink's Table API. Unfortunately, the Scala word count example provided in the [documentation|https://ci.apache.org/projects/flink/flink-docs-master/libs/table.html] doesn't work and does not give a meaningful exception.
> (Other examples work fine)
> Here my code:
> {code:java}
> package org.apache.flink.examples.scala
> import org.apache.flink.api.scala._
> import org.apache.flink.api.scala.table._
> object WordCount {
>   def main(args: Array[String]): Unit = {
>     // set up execution environment
>     val env = ExecutionEnvironment.getExecutionEnvironment
>     case class WC(word: String, count: Int)
>     val input = env.fromElements(WC("hello", 1), WC("hello", 1), WC("ciao", 1))
>     val expr = input.toTable
>     val result = expr.groupBy('word).select('word, 'count.sum as 'count).toDataSet[WC]
>     result.print()
>   }
> }
> {code}
> Here the thrown exception:
> {code}
> Exception in thread "main" org.apache.flink.runtime.client.JobExecutionException: Job execution failed.
> 	at org.apache.flink.runtime.jobmanager.JobManager$$anonfun$handleMessage$1.applyOrElse(JobManager.scala:414)
> 	at scala.runtime.AbstractPartialFunction$mcVL$sp.apply$mcVL$sp(AbstractPartialFunction.scala:33)
> 	at scala.runtime.AbstractPartialFunction$mcVL$sp.apply(AbstractPartialFunction.scala:33)
> 	at scala.runtime.AbstractPartialFunction$mcVL$sp.apply(AbstractPartialFunction.scala:25)
> 	at org.apache.flink.runtime.LeaderSessionMessageFilter$$anonfun$receive$1.applyOrElse(LeaderSessionMessageFilter.scala:36)
> 	at scala.runtime.AbstractPartialFunction$mcVL$sp.apply$mcVL$sp(AbstractPartialFunction.scala:33)
> 	at scala.runtime.AbstractPartialFunction$mcVL$sp.apply(AbstractPartialFunction.scala:33)
> 	at scala.runtime.AbstractPartialFunction$mcVL$sp.apply(AbstractPartialFunction.scala:25)
> 	at org.apache.flink.runtime.LogMessages$$anon$1.apply(LogMessages.scala:33)
> 	at org.apache.flink.runtime.LogMessages$$anon$1.apply(LogMessages.scala:28)
> 	at scala.PartialFunction$class.applyOrElse(PartialFunction.scala:118)
> 	at org.apache.flink.runtime.LogMessages$$anon$1.applyOrElse(LogMessages.scala:28)
> 	at akka.actor.Actor$class.aroundReceive(Actor.scala:465)
> 	at org.apache.flink.runtime.jobmanager.JobManager.aroundReceive(JobManager.scala:104)
> 	at akka.actor.ActorCell.receiveMessage(ActorCell.scala:516)
> 	at akka.actor.ActorCell.invoke(ActorCell.scala:487)
> 	at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:254)
> 	at akka.dispatch.Mailbox.run(Mailbox.scala:221)
> 	at akka.dispatch.Mailbox.exec(Mailbox.scala:231)
> 	at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
> 	at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
> 	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.ExpressionSelectFunction caused an exception: null
> 	at org.apache.flink.runtime.operators.RegularPactTask.openUserCode(RegularPactTask.java:1368)
> 	at org.apache.flink.runtime.operators.chaining.ChainedMapDriver.openTask(ChainedMapDriver.java:47)
> 	at org.apache.flink.runtime.operators.RegularPactTask.openChainedTasks(RegularPactTask.java:1408)
> 	at org.apache.flink.runtime.operators.DataSourceTask.invoke(DataSourceTask.java:142)
> 	at org.apache.flink.runtime.taskmanager.Task.run(Task.java:581)
> 	at java.lang.Thread.run(Thread.java:745)
> Caused by: java.lang.NullPointerException
> 	at org.apache.flink.api.table.codegen.IndentStringContext$$anonfun$j$2.apply(Indenter.scala:30)
> 	at org.apache.flink.api.table.codegen.IndentStringContext$$anonfun$j$2.apply(Indenter.scala:23)
> 	at scala.collection.TraversableLike$WithFilter$$anonfun$foreach$1.apply(TraversableLike.scala:772)
> 	at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59)
> 	at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:47)
> 	at scala.collection.TraversableLike$WithFilter.foreach(TraversableLike.scala:771)
> 	at org.apache.flink.api.table.codegen.IndentStringContext.j(Indenter.scala:23)
> 	at org.apache.flink.api.table.codegen.GenerateSelect.generateInternal(GenerateSelect.scala:55)
> 	at org.apache.flink.api.table.codegen.GenerateSelect.generateInternal(GenerateSelect.scala:32)
> 	at org.apache.flink.api.table.codegen.ExpressionCodeGenerator.generate(ExpressionCodeGenerator.scala:66)
> 	at org.apache.flink.api.table.runtime.ExpressionSelectFunction.open(ExpressionSelectFunction.scala:46)
> 	at org.apache.flink.api.common.functions.util.FunctionUtils.openFunction(FunctionUtils.java:33)
> 	at org.apache.flink.runtime.operators.RegularPactTask.openUserCode(RegularPactTask.java:1366)
> 	... 5 more
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)