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 2017/04/06 17:16:41 UTC

[jira] [Commented] (FLINK-6173) flink-table not pack-in com.fasterxml.jackson.* in after #FLINK-5414

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

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

GitHub user greghogan opened a pull request:

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

    [FLINK-6173] [build] Move gelly-examples jar from opt to examples

    The opt directory should be reserved for Flink JARs which users may optionally move to lib to be loaded by the runtime. flink-gelly-examples is a user program so is being moved to the examples folder.

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

    $ git pull https://github.com/greghogan/flink 6193_move_gelly_examples_jar_from_opt_to_examples

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

    https://github.com/apache/flink/pull/3690.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 #3690
    
----

----


> flink-table not pack-in com.fasterxml.jackson.* in after #FLINK-5414
> --------------------------------------------------------------------
>
>                 Key: FLINK-6173
>                 URL: https://issues.apache.org/jira/browse/FLINK-6173
>             Project: Flink
>          Issue Type: Bug
>          Components: Table API & SQL
>            Reporter: Zhenghua Gao
>
> Currently, flink-table will pack-in com.fasterxml.jackson.* and rename them to org.apache.flink.shaded.calcite.com.fasterxml.jackson.*
> If a project depends on flink-table, and uses fasterxml as follows(function explain uses fasterxml indirectly):
> {code:title=WordCount.scala|borderStyle=solid}
> object WordCountWithTable {
>   def main(args: Array[String]): Unit = {
>     // set up execution environment
>     val env = ExecutionEnvironment.getExecutionEnvironment
>     val tEnv = TableEnvironment.getTableEnvironment(env)
>     val input = env.fromElements(WC("hello", 1), WC("hello", 1), WC("ciao", 1))
>     val expr = input.toTable(tEnv)
>     val result = expr
>       .groupBy('word)
>       .select('word, 'frequency.sum as 'frequency)
>       .filter('frequency === 2)
>     println(tEnv.explain(result))
>     result.toDataSet[WC].print()
>   }
>   case class WC(word: String, frequency: Long)
> }
> {code}
> It actually uses org.apache.flink.shaded.calcite.com.fasterxml.jackson.*
> I found after FLINK-5414,  flink-table didn't pack-in com.fasterxml.jackson.* and the project would throw class not found exception.
> {code:borderStyle=solid}
> Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/flink/shaded/calcite/com/fasterxml/jackson/databind/ObjectMapper
> 	at org.apache.flink.table.explain.PlanJsonParser.getSqlExecutionPlan(PlanJsonParser.java:32)
> 	at org.apache.flink.table.api.BatchTableEnvironment.explain(BatchTableEnvironment.scala:143)
> 	at org.apache.flink.table.api.BatchTableEnvironment.explain(BatchTableEnvironment.scala:164)
> 	at org.apache.flink.quickstart.WordCountWithTable$.main(WordCountWithTable.scala:34)
> 	at org.apache.flink.quickstart.WordCountWithTable.main(WordCountWithTable.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:498)
> 	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
> Caused by: java.lang.ClassNotFoundException: org.apache.flink.shaded.calcite.com.fasterxml.jackson.databind.ObjectMapper
> 	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
> 	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
> 	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
> 	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
> 	... 10 more
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)