You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Yangze Guo (Jira)" <ji...@apache.org> on 2020/01/06 03:18:00 UTC

[jira] [Commented] (FLINK-15477) Create BatchTableEnvironment failed.

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

Yangze Guo commented on FLINK-15477:
------------------------------------

Hi, could you find
{code:java}
flink-table-planner_${flink.scala.version}
{code}
in your dependency library? If not, I think you need to ensure the flink-table-planner_${flink.scala.version} is added to your maven profile and try to rebuild the project.

> Create BatchTableEnvironment failed.
> ------------------------------------
>
>                 Key: FLINK-15477
>                 URL: https://issues.apache.org/jira/browse/FLINK-15477
>             Project: Flink
>          Issue Type: Bug
>          Components: API / Scala, Table SQL / API
>    Affects Versions: 1.9.1
>         Environment: * IntelliJ 2019.3 CE
> * Scala 2.12.1
> * Flink 1.9.1
>            Reporter: Muideen A. Lawal
>            Priority: Major
>
> 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;
>  
> {code:java}
> import org.apache.flink.api.scala._
> import org.apache.flink.table.api._
> import org.apache.flink.table.api.scala._
> {code}
>  
> I keep getting error at the point of creating table environment.
> {code:java}
> val env = ExecutionEnvironment.getExecutionEnvironment
> val tblEnv = BatchTableEnvironment.create(env){code}
> See below the error message I get below;
>  
> {code:java}
> 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 
> {code}
> 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.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)