Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-34583

Bug for dynamic table option hints with multiple CTEs

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.18.1
    • None
    • Table SQL / Planner
    • None

    Description

      The table options hints don't work well with multiple WITH clauses referring to the same table. Please see the following example.

       

      The following query with hints works well.

      SELECT * FROM T1 /*+ OPTIONS('foo' = 'bar') */ WHERE...;

      The following query with multiple WITH clauses also works well.

      WITH T2 AS (SELECT * FROM T1 /*+ OPTIONS('foo' = 'bar') */ WHERE...),
      T3 AS (SELECT ... FROM T2 WHERE...)
      SELECT * FROM T3;

      The following query with multiple WITH clauses referring to the same original table failed to recognize the hints.

      WITH T2 AS (SELECT * FROM T1 /*+ OPTIONS('foo' = 'bar') */ WHERE...),
      T3 AS (SELECT ... FROM T2 WHERE...),
      T4 AS (SELECT ... FROM T2 WHERE...),
      T5 AS (SELECT ... FROM T3 JOIN T4 ON...)
      SELECT * FROM T5;

      Attachments

        1. image-2024-04-17-16-35-06-153.png
          155 kB
          Xingcan Cui
        2. image-2024-04-17-16-48-49-073.png
          155 kB
          Xingcan Cui

        Activity

          People

            Unassigned Unassigned
            xccui Xingcan Cui
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated: