Hello-world example of Flink Table API using a edited Calcite rule
Posted by Felipe Gutierrez on URL: http://deprecated-apache-flink-user-mailing-list-archive.369.s1.nabble.com/Hello-world-example-of-Flink-Table-API-using-a-edited-Calcite-rule-tp28422.html
Hi,
does someone have a simple example using Table API and a Calcite rule which change/optimize the query execution plan of a query in Flink?
From the official documentation, I know that I have to create a CalciteConfig object [1]. Then, I based my firsts tests on this stackoverflow post [2] and I implemented this piece of code:
// change the current calcite config plan CalciteConfigBuilder ccb = new CalciteConfigBuilder(); RuleSet ruleSets = RuleSets.ofList(FilterMergeRule.INSTANCE); ccb.addLogicalOptRuleSet(ruleSets); TableConfig tableConfig = new TableConfig(); tableConfig.setCalciteConfig(ccb.build());
I suppose that with this I can change the query plan of the Flink Table API. I am also not sure if I will need to use an external catalog like this post assumes to use [3]. In a nutshell, I would like to have a simple example where I can execute a query using Flink Table API and change its query execution plan using a Calcite rule. Does anyone have a Hello world of it? I plan to use it on this example [4].