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

Vasia Kalavri commented on FLINK-3506:
--------------------------------------

I think this issue is invalid after the calc translation. The example currently 
produces the following plans:

{code}
Input Plan:
-----------
LogicalFilter(condition=[<>(MOD($0, 2), 0)])
  LogicalFilter(condition=[=(MOD($1, 2), 0)])
    LogicalFilter(condition=[<>(MOD($0, 2), 0)])
      LogicalTableScan(table=[[DataSetTable_0]])

---------------
Optimized Plan:
---------------
FlinkCalc(expr#0..2=[{inputs}], expr#3=[2], expr#4=[MOD($t0, $t3)], expr#5=[0], 
expr#6=[<>($t4, $t5)], expr#7=[MOD($t1, $t3)], expr#8=[=($t7, $t5)], 
expr#9=[AND($t8, $t6)], expr#10=[AND($t6, $t9)], proj#0..2=[{exprs}], 
$condition=[$t10])
  FlinkScan(table=[[DataSetTable_0]])

-------------
DataSet Plan:
-------------
DataSetFlatMap(name=[rel#41:FlinkCalc.FLINK.[[]](input=rel#40:Subset#4.FLINK.[],expr#0..2={inputs},expr#3=2,expr#4=MOD($t0,
 $t3),expr#5=0,expr#6=<>($t4, $t5),expr#7=MOD($t1, $t3),expr#8==($t7, 
$t5),expr#9=AND($t8, $t6),expr#10=AND($t6, 
$t9),a=$t0,b=$t1,c=$t2,$condition=$t10)])
  DataSetSource(table=[[DataSetTable_0]])
{code}

> ReduceExpressionsRule does not remove duplicate expression in Filter
> --------------------------------------------------------------------
>
>                 Key: FLINK-3506
>                 URL: https://issues.apache.org/jira/browse/FLINK-3506
>             Project: Flink
>          Issue Type: Improvement
>          Components: Table API
>            Reporter: Chengxiang Li
>            Priority: Minor
>
> {noformat}
> val ds = CollectionDataSets.get3TupleDataSet(env).as('a, 'b, 'c)
> val filterDs = ds.filter('a % 2 !== 0).filter('b % 2 === 0).filter('a % 2 !== 
> 0)
> {noformat}
> According to the ReduceExpressionsRule definition, we expect the duplicted 
> filter expression get removed, while it's not after logical optimization.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to