开发者社区> 问答> 正文

Pyflink1.12尝试连接oracle数据,报错信息怎么修改?

pyflink小白,测试pyflink1.12功能,想通过定义connector从oracle数据库中获取数据  通过如下方式定义:  env = StreamExecutionEnvironment.get_execution_environment()  env.set_parallelism(1)  env = StreamTableEnvironment \  .create(env, environment_settings=EnvironmentSettings  .new_instance()  .use_blink_planner().build())  source_ddl1 = """  CREATE TABLE source_table (id BIGINT,pf_id VARCHAR,\  tree_id VARCHAR,node_id VARCHAR,biz_date DATE,\  ccy_type VARCHAR,cur_id_d VARCHAR,tldrate DOUBLE,\  is_valid INT,time_mark TIMESTAMP) WITH (  'connector.type' = 'jdbc',  'connector.url' = 'jdbc:oracle:thin:@ip:dbnamel',  'connector.table' = 'ts_pf_ac_yldrate',  'connector.driver' = 'oracle.jdbc.driver.OracleDriver',  'connector.username' = 'xxx',  'connector.password' = 'xxx')  """  sql = "select pf_id,biz_date from source_table where biz_date='20160701' "  env.sql_update(source_ddl1)  table = env.sql_query(sql)  env.execute("flink_test")  报错信息:  raise java_exception  pyflink.util.exceptions.TableException: findAndCreateTableSource failed.  at org.apache.flink.table.factories.TableFactoryUtil.findAndCreateTableSource(TableFactoryUtil.java:49)  at org.apache.flink.table.planner.plan.schema.LegacyCatalogSourceTable.findAndCreateLegacyTableSource(LegacyCatalogSourceTable.scala:193)  at org.apache.flink.table.planner.plan.schema.LegacyCatalogSourceTable.toRel(LegacyCatalogSourceTable.scala:94)  at org.apache.calcite.sql2rel.SqlToRelConverter.toRel(SqlToRelConverter.java:3585)  at org.apache.calcite.sql2rel.SqlToRelConverter.convertIdentifier(SqlToRelConverter.java:2507)  at org.apache.calcite.sql2rel.SqlToRelConverter.convertFrom(SqlToRelConverter.java:2144)  at org.apache.calcite.sql2rel.SqlToRelConverter.convertFrom(SqlToRelConverter.java:2093)  at org.apache.calcite.sql2rel.SqlToRelConverter.convertFrom(SqlToRelConverter.java:2050)  at org.apache.calcite.sql2rel.SqlToRelConverter.convertSelectImpl(SqlToRelConverter.java:663)  at org.apache.calcite.sql2rel.SqlToRelConverter.convertSelect(SqlToRelConverter.java:644)  at org.apache.calcite.sql2rel.SqlToRelConverter.convertQueryRecursive(SqlToRelConverter.java:3438)  at org.apache.calcite.sql2rel.SqlToRelConverter.convertQuery(SqlToRelConverter.java:570)  at org.apache.flink.table.planner.calcite.FlinkPlannerImpl.org$apache$flink$table$planner$calcite$FlinkPlannerImpl$$rel(FlinkPlannerImpl.scala:165)  at org.apache.flink.table.planner.calcite.FlinkPlannerImpl.rel(FlinkPlannerImpl.scala:157)  at org.apache.flink.table.planner.operations.SqlToOperationConverter.toQueryOperation(SqlToOperationConverter.java:823)  at org.apache.flink.table.planner.operations.SqlToOperationConverter.convertSqlQuery(SqlToOperationConverter.java:795)  at org.apache.flink.table.planner.operations.SqlToOperationConverter.convert(SqlToOperationConverter.java:250)  at org.apache.flink.table.planner.delegation.ParserImpl.parse(ParserImpl.java:78)  at org.apache.flink.table.api.internal.TableEnvironmentImpl.sqlQuery(TableEnvironmentImpl.java:639)  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)  at java.lang.reflect.Method.invoke(Method.java:498)  at org.apache.flink.api.python.shaded.py4j.reflection.MethodInvoker.invoke(MethodInvoker.java:244)  at org.apache.flink.api.python.shaded.py4j.reflection.ReflectionEngine.invoke(ReflectionEngine.java:357)  at org.apache.flink.api.python.shaded.py4j.Gateway.invoke(Gateway.java:282)  at org.apache.flink.api.python.shaded.py4j.commands.AbstractCommand.invokeMethod(AbstractCommand.java:132)  at org.apache.flink.api.python.shaded.py4j.commands.CallCommand.execute(CallCommand.java:79)  at org.apache.flink.api.python.shaded.py4j.GatewayConnection.run(GatewayConnection.java:238)  at java.lang.Thread.run(Thread.java:748)*来自志愿者整理的flink邮件归档

展开
收起
又出bug了-- 2021-12-02 11:34:58 694 0
1 条回答
写回答
取消 提交回答
  • 目前 JDBC connector 只支持 MySQL, Pg和Derby(一般测试用)这几种dialect, Oracle还不支持。*来自志愿者整理的FLINK邮件归档

    2021-12-02 14:19:38
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

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

相关镜像