开发者社区 > 大数据与机器学习 > 实时计算 Flink > 正文

oracle-cdc2.4.1新插数据报file is not a valid field name

有人遇到过这个问题吗,我用的flink1.7,oracle-cdc 2.4.1 ,oracle版本12c,我创建了一张cdc表,然后直接print输出,在源表里新插入数据时报file is not a valid field name这个错,网上说什么flink字段类型和数据库不匹配,可是我字段类型是匹配的啊
image.png
4f103da3f60bd902c9a0475306c66bb.png
我尝试吧oracle-cdc 2.4改成了3.1.1,运行起来代码直接报错:
java.lang.ClassNotFoundException: org.apache.flink.shaded.guava31.com.google.common.util.concurrent.ThreadFactoryBuilder

代码demo如下:
Configuration configuration = new Configuration();
configuration.setInteger("rest.port", 9091);
StreamExecutionEnvironment env = StreamExecutionEnvironment.createLocalEnvironmentWithWebUI(configuration);
env.enableCheckpointing(3000);
env.getCheckpointConfig().setCheckpointStorage("file:/d:/ckpt");
StreamTableEnvironment tableEnv = StreamTableEnvironment.create(env);

    // 创建源端逻辑表
    String createSourceTableSQL = "CREATE TABLE TEST3 (" +
          "  ID bigint ,                            "+
          "  NAME string,                       "+
          "  AGE bigint,                        "+
          "  PRIMARY KEY (ID) NOT ENFORCED      "+
            ") WITH (" +
            "  'connector' = 'oracle-cdc', " +
            "  'hostname' = '10.26.73.98', " +
            "  'port' = '1521', " +
            "  'username' = 'cdc_cdl', " +
            "  'password' = 'cdc_cdl', " +
            "  'database-name' = 'testdb', " +
            "  'schema-name' = 'TEST', " +
            "  'table-name' = 'CDL_TEST3', " +
            "  'scan.startup.mode' = 'latest-offset', " +
            "  'debezium.log.mining.strategy' = 'online_catalog', " +
            "  'debezium.log.mining.continuous.mine' = 'true'," +
            "  'debezium.database.tablename.case.insensitive'='false' " +
            ");";
    tableEnv.executeSql(createSourceTableSQL);
    tableEnv.executeSql("select * from TEST3").print();

maven如下:


8
8
1.17.1
2.12



org.apache.flink
flink-table-runtime
${flink.version}


org.apache.flink
flink-runtime-web
${flink.version}


org.apache.flink
flink-connector-jdbc
3.1.0-1.17


com.ververica
flink-connector-oracle-cdc
2.4.1
  <dependency>
      <groupId>org.apache.flink</groupId>
      <artifactId>flink-table-planner_${scala.version}</artifactId>
      <version>${flink.version}</version>
 </dependency>
  <dependency>
      <groupId>org.apache.flink</groupId>
      <artifactId>flink-table-api-java</artifactId>
      <version>${flink.version}</version>
  </dependency>
<dependency>
    <groupId>org.apache.flink</groupId>
    <artifactId>flink-connector-base</artifactId>
    <version>${flink.version}</version>
</dependency>
    <dependency>
        <groupId>org.apache.flink</groupId>
        <artifactId>flink-streaming-java</artifactId>
        <version>1.17.1</version>
    </dependency>
    <dependency>
        <groupId>org.apache.flink</groupId>
        <artifactId>flink-clients</artifactId>
        <version>1.17.1</version>
    </dependency>
    <dependency>
        <groupId>org.slf4j</groupId>
 </dependency>

展开
收起
游客zex75r6kmjl7g 2024-10-22 18:13:29 22 0
0 条回答
写回答
取消 提交回答

实时计算Flink版是阿里云提供的全托管Serverless Flink云服务,基于 Apache Flink 构建的企业级、高性能实时大数据处理系统。提供全托管版 Flink 集群和引擎,提高作业开发运维效率。

相关电子书

更多
PostgresChina2018_樊文凯_ORACLE数据库和应用异构迁移最佳实践 立即下载
PostgresChina2018_王帅_从Oracle到PostgreSQL的数据迁移 立即下载
Oracle云上最佳实践 立即下载

相关镜像