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

Xuyang Zhong updated FLINK-38634:
---------------------------------
    Description: 
Take the following test as example:

 
{code:java}
// batch CalcTest
@Test
def test(): Unit = {
  val tEnv = util.tableEnv
  tEnv.executeSql("""
                    |create table src(
                    | a int,
                    | b int,
                    | pt as proctime()
                    |) with (
                    | 'connector' = 'values',
                    | 'bounded' = 'true'
                    |)
                    |""".stripMargin)

  tEnv.executeSql("""
                    |create table dim(
                    | a int,
                    | b int
                    |) with (
                    | 'connector' = 'values',
                    | 'filterable-fields' = 'b',
                    | 'bounded' = 'true'
                    |)
                    |""".stripMargin)

  util.verifyRelPlan(
    """
      |select src.* from src join dim for system_time as of src.pt on src.a = 
dim.a and dim.b = 1
      |""".stripMargin)

} {code}
After CalcSnapshotTransposeRule, we lack 
PushFilterInCalcIntoTableSourceScanRule to push down filter in the calc to 
source.

!image-2025-11-05-14-16-16-296.png|width=697,height=165!

  was:
Take the following test as example:

 
{code:java}
// batch CalcTest
@Test
def test(): Unit = {
  val tEnv = util.tableEnv
  tEnv.executeSql("""
                    |create table src(
                    | a int,
                    | b int,
                    | pt as proctime()
                    |) with (
                    | 'connector' = 'values',
                    | 'bounded' = 'true'
                    |)
                    |""".stripMargin)

  tEnv.executeSql("""
                    |create table dim(
                    | a int,
                    | b int
                    |) with (
                    | 'connector' = 'values',
                    | 'filterable-fields' = 'b',
                    | 'bounded' = 'true'
                    |)
                    |""".stripMargin)

  util.verifyRelPlan(
    """
      |select src.* from src join dim for system_time as of src.pt on src.a = 
dim.a and dim.b = 1
      |""".stripMargin)

} {code}
 

after CalcSnapshotTransposeRule, we lack 
PushFilterInCalcIntoTableSourceScanRule to push down filter in the calc to 
source.

 


> The filter on the dim table will not be pushed down
> ---------------------------------------------------
>
>                 Key: FLINK-38634
>                 URL: https://issues.apache.org/jira/browse/FLINK-38634
>             Project: Flink
>          Issue Type: Improvement
>          Components: Table SQL / Planner
>    Affects Versions: 2.0.1, 2.1.1
>            Reporter: Xuyang Zhong
>            Assignee: Xuyang Zhong
>            Priority: Major
>         Attachments: image-2025-11-05-14-16-16-296.png
>
>
> Take the following test as example:
>  
> {code:java}
> // batch CalcTest
> @Test
> def test(): Unit = {
>   val tEnv = util.tableEnv
>   tEnv.executeSql("""
>                     |create table src(
>                     | a int,
>                     | b int,
>                     | pt as proctime()
>                     |) with (
>                     | 'connector' = 'values',
>                     | 'bounded' = 'true'
>                     |)
>                     |""".stripMargin)
>   tEnv.executeSql("""
>                     |create table dim(
>                     | a int,
>                     | b int
>                     |) with (
>                     | 'connector' = 'values',
>                     | 'filterable-fields' = 'b',
>                     | 'bounded' = 'true'
>                     |)
>                     |""".stripMargin)
>   util.verifyRelPlan(
>     """
>       |select src.* from src join dim for system_time as of src.pt on src.a = 
> dim.a and dim.b = 1
>       |""".stripMargin)
> } {code}
> After CalcSnapshotTransposeRule, we lack 
> PushFilterInCalcIntoTableSourceScanRule to push down filter in the calc to 
> source.
> !image-2025-11-05-14-16-16-296.png|width=697,height=165!



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to