[jira] [Created] (FLINK-22303) FlinkRelMdFilteredColumnInterval should remapping the columnIndex of the inputRel otherwise may cause IllegalArgumentException or get incorrectly metadata

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Created] (FLINK-22303) FlinkRelMdFilteredColumnInterval should remapping the columnIndex of the inputRel otherwise may cause IllegalArgumentException or get incorrectly metadata

Shang Yuanchun (Jira)
lincoln lee created FLINK-22303:
-----------------------------------

             Summary: FlinkRelMdFilteredColumnInterval should remapping the columnIndex of the inputRel otherwise may cause IllegalArgumentException or get incorrectly metadata
                 Key: FLINK-22303
                 URL: https://issues.apache.org/jira/browse/FLINK-22303
             Project: Flink
          Issue Type: Bug
          Components: Table SQL / Planner
    Affects Versions: 1.12.2
            Reporter: lincoln lee


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

The following case will get an `IllegalArgumentException`

{code}

@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)
 }

{code}

{code}

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)

{code}

 

 

 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)