DataLinkDC / dinky

Dinky is a real-time data development platform based on Apache Flink, enabling agile data development, deployment and operation.
http://www.dinky.org.cn
Apache License 2.0
3.17k stars 1.16k forks source link

[Bug] [core] An exception about 'object 'Table' Not found' is thrown during task debugging when MockSink is turned on #3911

Closed MactavishCui closed 1 week ago

MactavishCui commented 1 week ago

Search before asking

What happened

b4fa4e9a694be55b06fcde6902fbb6b Paser.parse is used for DDL parse in MockStatementExplainer.java, but this method will check if all tables of query exist if the statement is CTAS type. For example, when parsing a statement like 'CREATE VIEW AS SELECT * FROM table_source', An Object Not found exception will be thrown as is shown above

What you expected to happen

Task debug will not work when MockSink is turn on.

How to reproduce

A possible solution is that using Parser.parseSql() rather than Parser.parse(), this method can only check the grammar of a single statement and parse it, which is more suitable for MockStatementExplainer. I'm willing to submit a PR to fix this issue and it is submitted in this link: https://github.com/DataLinkDC/dinky/pull/3908/ Because parseSql can be called by Parser in flink1.14-1.15, by ExtendParser in flink 1.16-1.17 by ExtendedParser.getCustomParser in flink 1.18-1.20, codes in dinky-client is also changed. Looking forward to your reply

Anything else

No response

Version

dev

Are you willing to submit PR?

Code of Conduct