You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Hequn Cheng (JIRA)" <ji...@apache.org> on 2019/03/14 06:38:00 UTC

[jira] [Commented] (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:comment-tabpanel&focusedCommentId=16792393#comment-16792393 ] 

Hequn Cheng commented on FLINK-11890:
-------------------------------------

Cool, looking forward to the proposal.

> 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: API / Table SQL
>            Reporter: Timo Walther
>            Assignee: Timo Walther
>            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
(v7.6.3#76005)