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

FlinkRelMdFilteredColumnInterval should remapping the columnIndex of the inputRel otherwise may cause IllegalArgumentException or get incorrectly metadata

    XMLWordPrintableJSON

Details

    Description

      FlinkRelMdFilteredColumnInterval should remapping the columnIndex of the inputRel otherwise may cause IllegalArgumentException or get incorrectly metadata.

      The following case will get an `IllegalArgumentException`

      
      @Test
       def testFilteredColumnIntervalValidation(): Unit = {
       util.verifyExecPlan(
       s"""
       |select
       | sum(uv) filter (where c = 'all') as all_uv
       |from (
       | select
       | c, count(1) as uv
       | from T
       | group by c
       |) t
       |""".stripMargin)
       }
      
      
      
      Caused by: java.lang.IllegalArgumentExceptionCaused by: java.lang.IllegalArgumentException at org.apache.flink.util.Preconditions.checkArgument(Preconditions.java:122) at org.apache.flink.table.planner.plan.stats.ValueInterval$.compare(ValueInterval.scala:290) at org.apache.flink.table.planner.plan.stats.ValueInterval$.compareAndHandle(ValueInterval.scala:304) at org.apache.flink.table.planner.plan.stats.ValueInterval$.isIntersected(ValueInterval.scala:247) at org.apache.flink.table.planner.plan.stats.ValueInterval$.intersect(ValueInterval.scala:189) at org.apache.flink.table.planner.plan.utils.ColumnIntervalUtil$$anonfun$5$$anonfun$8.apply(ColumnIntervalUtil.scala:226) at org.apache.flink.table.planner.plan.utils.ColumnIntervalUtil$$anonfun$5$$anonfun$8.apply(ColumnIntervalUtil.scala:226) at scala.collection.IndexedSeqOptimized$class.foldl(IndexedSeqOptimized.scala:57) at scala.collection.IndexedSeqOptimized$class.foldLeft(IndexedSeqOptimized.scala:66) at scala.collection.mutable.ArrayBuffer.foldLeft(ArrayBuffer.scala:48) at org.apache.flink.table.planner.plan.utils.ColumnIntervalUtil$$anonfun$5.apply(ColumnIntervalUtil.scala:226) at org.apache.flink.table.planner.plan.utils.ColumnIntervalUtil$$anonfun$5.apply(ColumnIntervalUtil.scala:221) at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:234) at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:234) at scala.collection.Iterator$class.foreach(Iterator.scala:891) at scala.collection.AbstractIterator.foreach(Iterator.scala:1334) at scala.collection.IterableLike$class.foreach(IterableLike.scala:72) at scala.collection.AbstractIterable.foreach(Iterable.scala:54) at scala.collection.TraversableLike$class.map(TraversableLike.scala:234) at scala.collection.AbstractTraversable.map(Traversable.scala:104) at org.apache.flink.table.planner.plan.utils.ColumnIntervalUtil$.getColumnIntervalWithFilter(ColumnIntervalUtil.scala:221) at org.apache.flink.table.planner.plan.metadata.FlinkRelMdFilteredColumnInterval.getFilteredColumnInterval(FlinkRelMdFilteredColumnInterval.scala:137)
      
      

       

       

       

      Attachments

        Issue Links

          Activity

            People

              lincoln.86xy lincoln lee
              lincoln.86xy lincoln lee
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: