Hi Jark,

thanks for the proposal. This is a great effort to finalize the new API design.

I'm wondering if we could simply use the SQL parser like `org.apache.calcite.sql.parser.SqlParser#parseExpression(..)` to parse an expression that contain only literals. This would avoid any discussion as the syntax is already defined by the SQL standard. And it would also be very unlikely to have a need for a version.

For example:

CALL('FUNC', FIELD('f0'), VALUE('TIMESTAMP(3)', TIMESTAMP '2019-10-21 12:12:12'))

Or even further if the SQL parser allows that:

CALL('FUNC', `cat`.`db`.`f0`, TIMESTAMP '2019-10-21 12:12:12')

I would find it confusing if we use different representation for literals such as intervals and timestamps in the properties. This would also reduce code duplication as we reuse logic for parsing identifiers etc.

What do you think?

Regards,
Timo


On 18.10.19 12:28, Jark Wu wrote:
Hi everyone,

I would like to start a discussion[1] about how to make Expression string
serializable and deserializable. Expression is the general interface for
all kinds of expressions in Flink Table API & SQL, it represents a logical
tree for producing a computation result. In FLIP-66[2] and FLIP-70[3], we
introduced watermark and computed column syntax in DDL. The watermark
strategy and computed column are both represented in Expression. In order
to persist watermark and computed column information in catalog, we need to
figure out how to persist and restore Expression.

FLIP-80:
https://docs.google.com/document/d/1LxPEzbPuEVWNixb1L_USv0gFgjRMgoZuMsAecS_XvdE/edit?usp=sharing

Thanks for any feedback!

Best,
Jark

[1]:
https://docs.google.com/document/d/1LxPEzbPuEVWNixb1L_USv0gFgjRMgoZuMsAecS_XvdE/edit?usp=sharing
[2]:
https://cwiki.apache.org/confluence/display/FLINK/FLIP-66%3A+Support+time+attribute+in+SQL+DDL
[3]:
https://cwiki.apache.org/confluence/display/FLINK/FLIP-70%3A+Flink+SQL+Computed+Column+Design


Reply via email to