You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Dawid Wysakowicz (Jira)" <ji...@apache.org> on 2020/10/27 14:48:00 UTC

[jira] [Closed] (FLINK-11890) Replace Table API string-based expressions by a Java DSL

     [ https://issues.apache.org/jira/browse/FLINK-11890?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dawid Wysakowicz closed FLINK-11890.
------------------------------------
    Resolution: Implemented

> Replace Table API string-based expressions by a Java DSL
> --------------------------------------------------------
>
>                 Key: FLINK-11890
>                 URL: https://issues.apache.org/jira/browse/FLINK-11890
>             Project: Flink
>          Issue Type: New Feature
>          Components: Table SQL / API
>            Reporter: Timo Walther
>            Assignee: Dawid Wysakowicz
>            Priority: Major
>
> Currently, expressions in the Table API can be defined in two ways. Either via the implicit Scala DSL or via custom strings:
> {code}
> Table revenue = orders
>   .filter("cCountry === 'FRANCE'")
>   .groupBy("cID, cName")
>   .select("cID, cName, revenue.sum AS revSum");
> // vs.
> val revenue = orders
>   .filter('cCountry === "FRANCE")
>   .groupBy('cID, 'cName)
>   .select('cID, 'cName, 'revenue.sum AS 'revSum)
> {code}
> The Java version of the Table API was always treated as a third class citizen.
> In the past the string-based expression parser was/is:
> - multiple times out of sync with the Scala DSL
> - buggy because it was not properly tested
> - it blows up the API as every method must accept both representations like {{select(String)}} and {{select(Expression)}}
> - confusing for users because it looks like SQL but is actually only SQL-like
> - does not provide JavaDocs or further help in case of parse errors within the IDE, a user can only consult the online documentation
> We should discuss alternatives for the string-based expressions and might come up with a DSL-like approach to make the Table API ready for the future.
> This issue would be a big design shift for Table API users in Java. We need to discuss if the benefits are worth the change. A first proof-of-concept/design proposal will follow shortly.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)