You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Jark Wu (Jira)" <ji...@apache.org> on 2019/12/12 10:51:00 UTC

[jira] [Commented] (FLINK-15218) java.lang.NoClassDefFoundError: org/apache/flink/table/sources/TableSource

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

Jark Wu commented on FLINK-15218:
---------------------------------

Hi, if you want to run it in IDEA, you should add planner dependency, e.g. if you would like to run in old planner. You can also refer the dependency section in documentation for more details [1].


{code}
<dependency>
  <groupId>org.apache.flink</groupId>
  <artifactId>flink-table-planner_2.11</artifactId>
  <version>1.9.0</version>
</dependency>
{code}



Note that {{BatchTableEnvironment}} can only work in old planner. In blink planner, batch mode is supported via {{TableEnvironment}}.

[1]: https://ci.apache.org/projects/flink/flink-docs-master/dev/table/#table-program-dependencies

> java.lang.NoClassDefFoundError: org/apache/flink/table/sources/TableSource
> --------------------------------------------------------------------------
>
>                 Key: FLINK-15218
>                 URL: https://issues.apache.org/jira/browse/FLINK-15218
>             Project: Flink
>          Issue Type: Bug
>         Environment: IDEA 2019.2
> jdk 1.8
> no local flink envirment
>            Reporter: tyler fan
>            Priority: Major
>
> trying application develop in IDE,
>  
> making a simple app like read csv file and register like a table,
> ------------------------------------
> final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
> BatchTableEnvironment tableEnv = BatchTableEnvironment.create(env);
> String[] colname = new String[] \{"CountryName","CountryCode","IndicatorName","IndicatorCode","1960"};
> TypeInformation<?>[] coltype = new TypeInformation<?>[] \{Types.STRING,Types.STRING,Types.STRING,Types.STRING,Types.STRING};
> TableSource dds = new CsvTableSource("/home/tylerf/sampledata/gpd.csv",colname,coltype);
> tableEnv.registerTableSource("gpd", dds);
> Table tab = tableEnv.scan("gpd");
>  
> -------------------------------------
> In IDEA
> got the error like this when i running the sample.
> ------------------------------------
> java.lang.NoClassDefFoundError: org/apache/flink/table/sources/TableSource
> ------------------------------------
> pom is configed the dependence by the document 1.9
> -------------------------------------
> <dependency>
>  <groupId>org.apache.flink</groupId>
>  <artifactId>flink-java</artifactId>
>  <version>${flink.version}</version>
>  <scope>provided</scope>
> </dependency>
> <dependency>
>  <groupId>org.apache.flink</groupId>
>  <artifactId>flink-streaming-java_${scala.binary.version}</artifactId>
>  <version>${flink.version}</version>
>  <scope>provided</scope>
> </dependency>
> <dependency>
>  <groupId>org.apache.flink</groupId>
>  <artifactId>flink-table-api-java-bridge_2.11</artifactId>
>  <version>1.9.0</version>
>  <scope>provided</scope>
> </dependency>
> ---------------------------------------------------------
>  



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