Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Cannot Reproduce
-
1.9.1
-
None
-
- IntelliJ 2019.3 CE
- Scala 2.12.1
- Flink 1.9.1
Description
Hi everyone,
I have been trying to use Table API but can't make it work for some reason I do not understand.
I have added the dependencies as specified here ([#https://ci.apache.org/projects/flink/flink-docs-release-1.9/dev/table/]) and import the following in my Scala code;
import org.apache.flink.api.scala._ import org.apache.flink.table.api._ import org.apache.flink.table.api.scala._
I keep getting error at the point of creating table environment.
val env = ExecutionEnvironment.getExecutionEnvironment val tblEnv = BatchTableEnvironment.create(env)
See below the error message I get below;
Exception in thread "main" org.apache.flink.table.api.TableException: Create BatchTableEnvironment failed. at org.apache.flink.table.api.scala.BatchTableEnvironment$.create(BatchTableEnvironment.scala:308) at org.apache.flink.table.api.scala.BatchTableEnvironment$.create(BatchTableEnvironment.scala:269) at fr.flinkpro.debug.Oper2Flink$.main(Oper2Flink.scala:32) at fr.flinkpro.debug.Oper2Flink.main(Oper2Flink.scala)Caused by: java.lang.ClassNotFoundException: org.apache.flink.table.api.scala.internal.BatchTableEnvironmentImpl 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) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:264) at org.apache.flink.table.api.scala.BatchTableEnvironment$.create(BatchTableEnvironment.scala:292) ... 3 more
Also, what I'm trying to achieve is to rename a column. What I have done so far is converting from DS to Table API, rename the column and convert back to DS. Is this the best way to do it?
Any help on this will be appreciated.