You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@calcite.apache.org by Tamas Kiss <ta...@cloudera.com.INVALID> on 2021/07/19 06:58:02 UTC

Support user defined variables in Flink's SQL

Hi,

We are working on extending Flink's SQL-parser to be able to use user
defined variables in SQL queries. Currently we have a solution which uses
templating logic in the properties section of a CREATE TABLE statement and
we would like to support the same for columns, table names etc. .
Ideally our solution should support a query like this:

SET @table_name=my_table;

CRETAE TABLE @table_name (
    ....

As far as we know this parsing logic should be implemented through
Calcite's parser in Flink. Is that the right path to take? Could you please
help us with some examples on how to achieve our goal?

Thanks
Tamas