Appreciate if anyone had a chance to look at the Scala code in GitHub and advise Regards, Dr Mich Talebzadeh
LinkedIn https://www.linkedin.com/profile/view?id=AAEAAAAWh2gBxianrbJd6zP6AcPCCdOABUrV8Pw
http://talebzadehmich.wordpress.com Disclaimer: Use it at your own risk. Any and all responsibility for any loss, damage or destruction of data or any other property which may arise from relying on this email's technical content is explicitly disclaimed. The author will in no case be liable for any monetary damages arising from such loss, damage or destruction.
On Thu, 2 Aug 2018 at 09:06, Mich Talebzadeh <[hidden email]> wrote:
|
Hi Mich, I have reviewed your code in the github you provided. I copied your code to org.apache.flink.table.examples.scala under flink-examples-table. It passed the compilation and didn't report the exception you provided, although there are other exceptions (it's about hdfs, this is because of my environment). First of all, the necessary dependencies are just a few: <dependency> <groupId>org.apache.flink</groupId> <artifactId>flink-table_${scala.binary.version}</artifactId> <version>${project.version}</version> </dependency> <dependency> <groupId>org.apache.flink</groupId> <artifactId>flink-streaming-scala_${scala.binary.version}</artifactId> <version>${project.version}</version> </dependency> <dependency> <groupId>org.apache.flink</groupId> <artifactId>flink-connector-kafka-0.11_${scala.binary.version}</artifactId> <version>${project.version}</version> </dependency> Please remove irrelevant dependencies. In addition, your StreamExecutionEnvironment object has a problem with its reference. The correct path should be: Import org.apache.flink.streaming.api.scala.StreamExecutionEnvironment In addition, you specify four fields, but your stream object is DataStream[String]. This is also a mistake. You are advised to parse it first with a MapFunction. The example is as follows: Val dataStream = streamExecEnv .addSource(new FlinkKafkaConsumer011[String](topicsValue, new SimpleStringSchema(), properties)) Val newDateStream = dataStream.map(new MapFunction[String, Tuple4[String, String, String, String]] { Override def map(value: String): Tuple4[String, String, String, String] = { Return null } }) Val tableEnv = TableEnvironment.getTableEnvironment(streamExecEnv) //tableEnv.registerDataStream("table1", streamExecEnv, 'key, 'ticker, 'timeissued, 'price) tableEnv.registerDataStream("priceTable", newDateStream, 'key, 'ticker, 'timeissued, 'price) Thanks, vino. 2018-08-02 20:36 GMT+08:00 Mich Talebzadeh <[hidden email]>:
|
Thanks a lot Timo. I will try the changes suggested. Appreciated Dr Mich Talebzadeh
LinkedIn https://www.linkedin.com/profile/view?id=AAEAAAAWh2gBxianrbJd6zP6AcPCCdOABUrV8Pw
http://talebzadehmich.wordpress.com Disclaimer: Use it at your own risk. Any and all responsibility for any loss, damage or destruction of data or any other property which may arise from relying on this email's technical content is explicitly disclaimed. The author will in no case be liable for any monetary damages arising from such loss, damage or destruction.
On Fri, 3 Aug 2018 at 03:56, vino yang <[hidden email]> wrote:
|
Apologies should read Vino and Timo Dr Mich Talebzadeh
LinkedIn https://www.linkedin.com/profile/view?id=AAEAAAAWh2gBxianrbJd6zP6AcPCCdOABUrV8Pw
http://talebzadehmich.wordpress.com Disclaimer: Use it at your own risk. Any and all responsibility for any loss, damage or destruction of data or any other property which may arise from relying on this email's technical content is explicitly disclaimed. The author will in no case be liable for any monetary damages arising from such loss, damage or destruction.
On Fri, 3 Aug 2018 at 09:14, Mich Talebzadeh <[hidden email]> wrote:
|
In reply to this post by Mich Talebzadeh
Hi, I resolved this issue of java.lang.NoClassDefFoundError: org/apache/flink/table/api/TableEnvironment By adding the jar file flink-table_2.11-1.5.0.jar To $FLINK_HOME/lib It compiles and run OK now. Rather strange as I had this dependency in my SBT libraryDependencies += "org.apache.flink" %% "flink-table" % "1.5.0" % "provided" HTH Dr Mich Talebzadeh
LinkedIn https://www.linkedin.com/profile/view?id=AAEAAAAWh2gBxianrbJd6zP6AcPCCdOABUrV8Pw
http://talebzadehmich.wordpress.com Disclaimer: Use it at your own risk. Any and all responsibility for any loss, damage or destruction of data or any other property which may arise from relying on this email's technical content is explicitly disclaimed. The author will in no case be liable for any monetary damages arising from such loss, damage or destruction.
On Thu, 2 Aug 2018 at 08:26, Mich Talebzadeh <[hidden email]> wrote:
|
The problem is that you declared it as provided. This means the build tool assumes it will be there and therefore does not include it in the Jar file. By adding it to the lib folder you are providing the dependency. Best, Fabian 2018-08-06 18:58 GMT+02:00 Mich Talebzadeh <[hidden email]>:
|
Thanks Fabian, I looked at the maven and this is what it says <scope>provided</scope> Thanks Dr Mich Talebzadeh
LinkedIn https://www.linkedin.com/profile/view?id=AAEAAAAWh2gBxianrbJd6zP6AcPCCdOABUrV8Pw
http://talebzadehmich.wordpress.com Disclaimer: Use it at your own risk. Any and all responsibility for any loss, damage or destruction of data or any other property which may arise from relying on this email's technical content is explicitly disclaimed. The author will in no case be liable for any monetary damages arising from such loss, damage or destruction.
On Mon, 6 Aug 2018 at 18:14, Fabian Hueske <[hidden email]> wrote:
|
Hi Mich, I think this is the behavior of the compiler. When run your job in local, you have to remove the provided or add jar to the lib path. But if run on cluster, you have to add the provided to ignore flink classes, since these classes are already exist in your installation version. Best, Hequn On Tue, Aug 7, 2018 at 1:34 AM, Mich Talebzadeh <[hidden email]> wrote:
|
Ok gents thanks for clarification. Regards, Dr Mich Talebzadeh
LinkedIn https://www.linkedin.com/profile/view?id=AAEAAAAWh2gBxianrbJd6zP6AcPCCdOABUrV8Pw
http://talebzadehmich.wordpress.com Disclaimer: Use it at your own risk. Any and all responsibility for any loss, damage or destruction of data or any other property which may arise from relying on this email's technical content is explicitly disclaimed. The author will in no case be liable for any monetary damages arising from such loss, damage or destruction.
On Tue, 7 Aug 2018 at 02:21, Hequn Cheng <[hidden email]> wrote:
|
Free forum by Nabble | Edit this page |