使用DDL 定义connector连接Mysql数据库,想通过发送sql的方式直接获取数据: source_ddl = """ CREATE TABLE source_table( yldrate DECIMAL, pf_id VARCHAR, symbol_id VARCHAR) WITH( 'connector' = 'jdbc', 'url' = 'jdbc:mysql://ip/db', 'driver' = 'com.mysql.cj.jdbc.Driver', 'username' = 'xxx', 'password' = 'xxx', 'table-name' = 'TS_PF_SEC_YLDRATE' 'read.query' = "SELECT YLDRATE, PF_ID, SYMBOL_ID FROM TS_PF_SEC_YLDRATE LEFT JOIN TP_GL_DAY ON DAY_ID = BIZ_DATE WHERE CCY_TYPE = 'AC' AND PF_ID = '1030100122' AND SYMBOL_ID = '2030004042' AND BIZ_DATE between '20160701' AND '20170307'" ) """ 报错信息: File "C:\Users\18242\AppData\Local\Programs\Python\Python37\lib\site-packages\pyflink\table\table_environment.py", line 766, in execute_sql return TableResult(self._j_tenv.executeSql(stmt)) File "C:\Users\18242\AppData\Local\Programs\Python\Python37\lib\site-packages\py4j\java_gateway.py", line 1286, in call answer, self.gateway_client, self.target_id, self.name) File "C:\Users\18242\AppData\Local\Programs\Python\Python37\lib\site-packages\pyflink\util\exceptions.py", line 147, in deco return f(*a, **kw) File "C:\Users\18242\AppData\Local\Programs\Python\Python37\lib\site-packages\py4j\protocol.py", line 328, in get_return_value format(target_id, ".", name), value) py4j.protocol.Py4JJavaError: An error occurred while calling o6.executeSql. : org.apache.flink.table.api.SqlParserException: SQL parse failed. Encountered "=" at line 12, column 30. Was expecting one of: "UESCAPE" ... <QUOTED_STRING> ... ")" ... "," ...
提示期待的语法信息,没有看懂,为什么不能出现“=” ?希望路过的大佬,能够指导一下~~谢谢!*来自志愿者整理的flink邮件归档
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。