[ 
https://issues.apache.org/jira/browse/FLINK-7798?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16200247#comment-16200247
 ] 

Xingcan Cui commented on FLINK-7798:
------------------------------------

Hi [~fhueske], I tried to add the check logic, but encountered some problems.

In general, we need first to check if the join is performed in a 
{{StreamTableEnvironment}} (which is done in {{Join.validate()}} now). Then 
there two extra restrictions: (1) at least one equi-join predicate (checked in 
{{Join.validate()}} and {{FlinkLogicalJoin.matches()}} now) or the join is 
performed on a single row (checked in {{FlinkLogicalJoin.matches()}} now) and 
(2) the window bounds are defined and no rowtime fields exist in a proctime 
join (checked in {{DataStreamWindowJoinRule.matches()}} by 
{{WindowJoinUtil.extractWindowBoundsFromPredicate()}} now).

Apparently, these checks are distributed in different levels. First, I tried to 
combine them into the {{Join.validate()}}, but it's hard to generate the  
{{RexNode}} (used by {{WindowJoinUtil}}) for the predicate {{Expressions}}. 
After that, I tried to embed them into the {{Join.construct()}} since all the 
parameters needed by {{WindowJoinUtil}} ({{RelBuilder}}, {{RexNode}}, etc.)  
are available there. However, the {{TableEnvironment}} check can't be performed 
in this method.

IMO, these checks should be all or none. It seems we can only achieve our goal 
by rewriting the window bounds extractor to accept {{Expressions}} (not quite 
sure if it's feasible). Do you have any ideas?

> Add support for windowed joins to Table API
> -------------------------------------------
>
>                 Key: FLINK-7798
>                 URL: https://issues.apache.org/jira/browse/FLINK-7798
>             Project: Flink
>          Issue Type: Sub-task
>          Components: Table API & SQL
>    Affects Versions: 1.4.0
>            Reporter: Fabian Hueske
>            Assignee: Xingcan Cui
>            Priority: Critical
>             Fix For: 1.4.0
>
>
> Currently, windowed joins on streaming tables are only supported through SQL.
> The Table API should support these joins as well. For that, we have to adjust 
> the Table API validation and translate the API into the respective logical 
> plan. Since most of the code should already be there for the batch Table API 
> joins, this should be fairly straightforward.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to