Thanks for driving this FLIP. It should be a good improvement to users. But I have few questions: 1: Is the PlanAnalyzerFactory also expected to be implemented by users just like DynamicTableSourceFactory or other factories? If so, I notice that in the code of PlanAnalyzerManager#registerAnalyzers, the code is as follows: FactoryUtil.discoverFactory(classLoader, PlanAnalyzerFactory.class, StreamPlanAnalyzerFactory.STREAM_IDENTIFIER));
IIUC, it'll always find the factory with the name StreamPlanAnalyzerFactory.STREAM_IDENTIFIER; Is it a typo or by design ? 2: Is there any special reason make PlanAdvice be a final class? Would it be better to make it an interface and we provide a default implementation? My concern is some users may want have their own implementation for PlanAdvice. But it may be overthinking. If you think it won't bring any problem, I'm also fine with that. 3: Is there a way only show advice? For me, it seems the advice will be more useful and the nodes may contains to many details. 4: I'm curious about what't the global advice will look like. Is it possible to provide an example? Best regards, Yuxia ----- 原始邮件 ----- 发件人: "Jane Chan" <qingyue....@gmail.com> 收件人: "dev" <dev@flink.apache.org> 发送时间: 星期一, 2022年 12 月 26日 下午 9:39:18 主题: [DISCUSS] FLIP-280: Introduce a new explain mode to provide SQL advice Hi, devs, I would like to start a discussion on FLIP-280: Introduce a new explain mode to provide SQL advice[1]. Currently, Flink SQL EXPLAIN statement provides three details to display the plan. However, there is a considerable gap between the current explained result and the actual, applicable actions for users to improve their queries. To provide more understandable, actionable advice closer to the user's perspective, we propose a new explain mode that analyzes the physical plan and attaches available tuning advice and data correctness warnings. EXPLAIN ANALYZED_PHYSICAL_PLAN <query> I've included more details in [1], and I look forward to your feedback. [1] https://cwiki.apache.org/confluence/display/FLINK/FLIP-280%3A+Support+EXPLAIN+SQL+statements+with+advice [2] POC: https://github.com/LadyForest/flink/tree/FLIP-280 Best regards, Jane Chan